0

really stumped

asked 2009-11-26 15:40:35 +0800

bbrand gravatar image bbrand
98 3

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

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2009-11-26 16:10:11 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2009-11-26 16:11:40 +0800

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

link publish delete flag offensive edit

answered 2009-11-26 16:12:18 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

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>
...

link publish delete flag offensive edit

answered 2009-11-26 16:29:21 +0800

bbrand gravatar image bbrand
98 3

Thanks guys!! That did the trick, perfect.

Just for my own sanity: did I total miss something in the documentation or is this one of those "learn the hard way" items?

thanks again
Ben

link publish delete flag offensive edit

answered 2009-11-26 20:38:40 +0800

PeterKuo gravatar image PeterKuo
481 2

updated 2009-11-26 20:43:50 +0800

@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.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-11-26 15:40:35 +0800

Seen: 282 times

Last updated: Nov 26 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More