on 03-24-2015 5:47 PM
Hi folks,
this is likely an easy question. But nevertheless, my Widget Template always opens with the size 600px x 400px. And I don't know how to change the height.
Best regards, Clemens
You can set the size also in the view.zul file:
<widget xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.zkoss.org/2005/zul">
<style src="${wr}/default.css"/>
<div style="height:400px;">
....
</div>
</widget>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found a solution. But obviously not a smart one.
@Override
public void initialize(final Component comp) {
super.initialize(comp);
Window window = findAncestorWindow(comp);
if (window != null) {
window.setHeight("700px");
}
}
private static Window findAncestorWindow(Component component) {
Component current = component;
while (current != null && !(current instanceof Window) && !(current instanceof Widget)) {
current = current.getParent();
}
return current instanceof Window ? (Window) current : null;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.