0

Layout problems

asked 2009-02-18 12:32:59 +0800

Rico gravatar image Rico
175 1 1 2

Hi,

I am sure that this is something I do wrong, but I have BIG trouble getting components to behave in layouts (especially borderlayout). Furthermore, I have trouble when re-sizeing the browser and the componets are positioned in a borderlayout. No scrollbar appears and the lower part of the content disappears.

My applications are far to big to post here, so I thought I'd try and create the most simple example I could think of:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window border="none">
<borderlayout>
<center border="none">
<listbox height="800px">
<listitem>
<listcell>Howdy</listcell>
</listitem>
</listbox>
</center>
</borderlayout>
</window>
</zk>

A very simple page that contains a listbox with a fixed size inside the center of a borderlayout. When tested in Firefox 2 and maximized window it works, but if I resize the window the lisbox totally disappears.

Removing the borderlayout and just having the listbox in the window works like a charm. How can I get the borderlayout to behave as I think it is supposed to behave?

My apps is far more complex than this, but since I can't even get this to work, I think it is a good place to start.

Thanks for enlightning me!

Finest regards,
Rico

delete flag offensive retag edit

8 Replies

Sort by ยป oldest newest

answered 2009-02-18 13:04:31 +0800

guleri gravatar image guleri
75 2

Try setting a height on the borderlayout element.

link publish delete flag offensive edit

answered 2009-02-18 14:09:42 +0800

Rico gravatar image Rico
175 1 1 2

Thanks that works for the example! But it has to be a fixed height, right? I can not use height="100%" for instance?

/Rico

link publish delete flag offensive edit

answered 2009-02-19 10:19:06 +0800

A gravatar image A
117 2

<window border="none" width="100%" height="100%">
You should add to window size, Because the borderlayout was a window that contains

link publish delete flag offensive edit

answered 2009-02-25 02:56:48 +0800

sreed gravatar image sreed
195 1 3 5

I am having this same problem and I don't see the solutions proposed here working. When I try the following test, the bottom of the center region is clipped off by the footer and there is no scroll bar:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
  <window width="100%" height="100%" border="none">
    <borderlayout>
      <center border="none">
        <listbox height="800px">
          <listitem>
            <listcell>Howdy</listcell>
          </listitem>
        </listbox>
      </center>
      <south>
        <label value="footer"/>
      </south>
    </borderlayout>
  </window>
</zk>

If this is normal borderlayout behavior and there is no work-around then this component has very limited use.

link publish delete flag offensive edit

answered 2009-02-27 00:49:41 +0800

PeterKuo gravatar image PeterKuo
481 2

updated 2009-02-27 00:50:05 +0800

Please refer to javadoc of center, try to find keyword scroll,
and you'll find in LayoutRegion
http://www.zkoss.org/javadoc/3.5.2/zkex/org/zkoss/zkex/zul/LayoutRegion.html

boolean isAutoscroll()
Returns whether enable overflow scrolling.


boolean isCollapsible()
Returns whether set the initial display to collapse.

default is false.

link publish delete flag offensive edit

answered 2009-03-06 02:38:15 +0800

sreed gravatar image sreed
195 1 3 5

updated 2009-03-06 02:39:17 +0800

Peter,
I missed your comment here from last week so this reply is coming a little late.
1) I was looking in the Developer's Reference pages 96-98 for properties of the center component and didn't see anything about autoscroll or collapsible. Are we supposed to use the JavaDocs to to get documentation for ZUML components?
2) Setting autoscroll on the west, center and east adds a scrollbar to each region, not to the whole page so the user has to scroll each region separately! That's just not user-friendly.
3) I don't want the regions to collapse, so collapsible=false is fine as a default for me.
4) I want the layout to stay just the way it is laid out but to have a scroll bar for the whole layout area when the window is too small to contain it. That seems like the natural, least-surprising behavior.
Thanks,
Scott

link publish delete flag offensive edit

answered 2009-03-09 04:18:04 +0800

PeterKuo gravatar image PeterKuo
481 2

updated 2009-03-09 09:34:19 +0800

To sreed,
Thanks for your reply.
1)There is room to improve ZK documentations, and we're trying to enhance it. Therefore, we have wiki now. Due to ZK's fast development, the document may not be already sync to latest status. And java doc generated by source code is usually most up to date. We're also thinking about how to integrate javadoc and ZK developer reference.

As to 2),3),4) Please post it to feature request and we'll track it. Your feedback makes ZK more perfect. Thank you.

link publish delete flag offensive edit

answered 2009-03-15 12:24:05 +0800

fusion35 gravatar image fusion35
237 2 5

Try using style :

<borderlayout style="overflow:auto; height:100%; position:absolute; width: 100%;">

regards

Devinder

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-02-18 12:32:59 +0800

Seen: 457 times

Last updated: Mar 15 '09

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