-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello all,
I am preparing a layout with a top menu and a bar at the bottom.
I have tried many things but failed to set good layout.
<borderlayout>
<north>
<grid> <!-- GRID 1 (should be at the top)-->
.....
</grid>
</north>
<south>
<grid > <!-- GRID 2 (should be at the bottom)-->
.....
</grid>
</south>
</borderlayout>
this looks like what i need but if i dont set height property borderlayout shows nothing.
If I set the height="100%" it still shows nothing.
But if I set height="500px" it works within the 500px window.
How can I fix grid2 at the bottom without defining a fixed size? (client browser may resize)
I tried vflex it does not work too. (I may miss something, any suggestions will be welcomed)
Thanks,
Eray
do you mean a thing like a statusBar? like here in the aplication
That is definitely the layout I need.
Is it open-source?
Can I have layout code?
The whole app sources are free to use. Look here.
best
Stephan
<?page id="indexPage" title=" ZKoss sample application " cacheable="false" language="xul/html" zscriptLanguage="Java"?> <?meta content="text/html; charset=UTF-8" pageEncoding="UTF-8"?> <?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?> <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> <zk xmlns="http://www.zkoss.org/2005/zul" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd"> <window id="outerIndexWindow" apply="${indexCtrl}" border="none" width="100%" height="100%"> <style> body { padding: 0 0; /* 0 padding on top and bottom and 0 padding on right and left */ } </style> <!-- hidden fields for the current desktop height and width --> <intbox id="currentDesktopHeight" visible="false" /> <intbox id="currentDesktopWidth" visible="false" /> <checkbox id="CBtreeMenu" checked="true" visible="false" /> <borderlayout id="borderlayoutMain" height="100%"> <north id="borderlayoutMainNorth" border="none" splittable="false"> <div id="div1" style="background-color:#4944F9"> <hbox width="100%"> <h:div id="divNo" align="left"> <image src="/images/zkoss3.gif" /> </h:div> <h:div id="divNorth" align="left" style="padding:5px"> <label style="color:white; font-size:12px; font-weight:bold" value="ZKoss Sample Application ( ZK + Spring + Spring-Security + Hibernate + JasperReports )"> </label> </h:div> <h:div id="divNorthEast" align="right"> <button id="btnLogout" image="/images/icons/exit_door_16x16.gif" label="${c:l('btnLogout.label')}" tooltiptext="${c:l('btnLogout.tooltiptext')}" /> <!-- href="/index.zul" --> </h:div> </hbox> <separator bar="true" style="background-color:silver" /> <div id="divDropDownMenu" width="100%"> <menubar id="mainMenuBar" height="25px"></menubar> </div> </div> </north> <west border="none" margins="0,0,0,0" size="200px" flex="true" minsize="10" splittable="true" autoscroll="false"> <div id="divWest">WEST</div> </west> <center border="none" margins="0,0,0,0" flex="true"> <div id="divCenter">CENTER</div> </center> <east border="none" margins="0,0,0,0" size="0%"> <div id="divEast">EAST</div> </east> <south border="none" margins="1,0,0,0" height="20px" splittable="false" flex="true"> <div id="divSouth"> <grid id="statusBarGrid" fixedLayout="true" height="20px" width="100%"> <columns sizable="false"> <column label="User:" width="10%" /> <column id="statusBarColUser" label="" width="10%" /> <column label="Office-No.:" width="10%" /> <column id="statusBarColOfficeNo" label="" width="10%" /> <column label="Status" width="10%" /> <column id="statusBarColStatus" label="" width="10%" /> <column label="ZK Version" width="10%" /> <column id="statusBarAppVersion" label="" width="20%" /> <column id="colDate" width="20%" align="right" /> </columns> </grid> </div> </south> </borderlayout> <label id="lbl2" width="33%" /> <timer id="timer2" delay="1000" repeats="true"> <attribute name="onTimer"> Locale locale = org.zkoss.util.Locales.getCurrent(); java.text.DateFormat dateFormat = java.text.DateFormat.getDateTimeInstance( java.text.DateFormat.MEDIUM, java.text.DateFormat.MEDIUM, locale); String strTime = dateFormat.format(java.util.Calendar.getInstance(locale).getTime()); colDate.setLabel(strTime); </attribute> </timer> </window> </zk>
Terry thank you very much.
It was a lot to me.
outerIndexWindow did the trick.
After putting my borderlayout in an 100% height window it worked.
yours,
Eray
I'm having the same problem. But in my case I have windows inside a window.
<window> <borderlayout> ...... <center> <div> <window> .... </window> <window> .... </window> </div> </center> .... </window>
I gave them all width with percentage, but it will not show the complete window like ErayGursoy said it's only showing the window by defining a fixed size with px.
What can I do without defining a fixed size?
Window is a container. I recommend Panels instead of your inner windows. And/Or Tablelayouts, Grids
Asked: 2009-12-03 15:31:07 +0800
Seen: 739 times
Last updated: Dec 07 '09