-
FEATURED COMPONENTS
First time here? Check out the FAQ!
New to ZK, but being new to something is not a strange area for me. I usualy manage to figure things out. But this has got me totaly stumped. Can someone help out here?
If have this code:
<?xml version="1.0" encoding="UTF-8"?> <zk xmlns="http://www.zkoss.org/2005/zul"> <window title="My window"> <borderlayout> <north border="normal" height="10%"> the North </north> <center border="normal"> the Center </center> <south border="normal" height = "50%"> the South </south> </borderlayout> </window> <button label="the End"/> </zk>
I get the window header with the title directly followed by the button, but the borderlayout = no show, as if it did not exsist at all!!.
If I remove the the <window> then it does show up, but if I add components I get a wierd error that only one child is allowed when I try to load the page.
What is going on here?? I can find nothing in the forums or anywhere else on this one ..
thanks
Ben
You need an initial width and height of the window
<?xml version="1.0" encoding="UTF-8"?> <zk xmlns="http://www.zkoss.org/2005/zul"> <window title="My window" width="400px" height="400px"> <borderlayout> <north border="normal" height="10%">the North</north> <center border="normal">the Center</center> <south border="normal" height="50%">the South</south> </borderlayout> </window> <button label="the End" /> </zk>
or
<?xml version="1.0" encoding="UTF-8"?> <zk xmlns="http://www.zkoss.org/2005/zul"> <window title="My window" width="100%" height="100%"> <borderlayout> <north border="normal" height="10%">the North</north> <center border="normal">the Center</center> <south border="normal" height="50%">the South</south> </borderlayout> </window> <button label="the End" /> </z
best
Stephan
for the 1st problem just add an height attribute to window or borderlayout
fot the 2nd problem, borderlayot inner components (north, south, center, east and west) can have only one child, so what you do is something like this
... <center> <div> // all others components here </div> </center> ...
@bbrand
Welcome to ZK.
If you know how the doc is organized, you may find the trick by following sequence.
http://docs.zkoss.org/wiki/Developer%27s_Guide
http://docs.zkoss.org/wiki/Style_Customization
http://en.wikibooks.org/wiki/ZK/How-Tos/Concepts-and-Tricks#On_Width_and_Percentages
It would be "find the hard way"
I would like to suggest to reorganize developer reference.
Every component should have its own page describing some faq about it.
It's time consuming, but it should be worthy.
Asked: 2009-11-26 15:40:35 +0800
Seen: 282 times
Last updated: Nov 26 '09