-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is there any way that a window takes only as much space as its children need?
<?page id="econfirmDialog"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="./ecDialog"?>
<window id="ecDialog" title="${resolver.nls.mes_hdEmptyCompleteDialogTitle}"
closable="true" sizable="true" mode="modal" border="normal"
apply="com.camline.skmes.mes.webgui.controller.dialog.EmptyCompleteDialogController">
<borderlayout>
<center style="padding: 5px 5px;">
<vbox vflex="min" align="center" pack="center">
<label id="confirmText" style="font-size:150%;"/>
</vbox>
</center>
</borderlayout>
</window>
Right now, I only see the title bar and it allocates no space for the actual content (borderlayout). I want the window to be just as big as to fit the text, however long the text may be. I tried setting vflex="min" and hflex="min" but it doesn't change anything.
You made the mistake b setting the vflex="min"
to the wrong component.
Please try this :
<window id="ecDialog" title="testWindow"
closable="true" sizable="true" mode="modal" border="normal" vflex="min">
<borderlayout>
<center style="padding: 5px 5px;" vflex="min" hflex="1">
<vbox align="center" pack="center">
<label id="confirmText" style="font-size:150%;" value="test case" hflex="1"/>
</vbox>
</center>
</borderlayout>
</window>
Link to fiddle where you can see the result of this zul.
Greetz chill.
Asked: 2016-05-18 12:52:25 +0800
Seen: 22 times
Last updated: May 19 '16