-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello, I'm using Zk 3.0.7 with Firefox on a Mac. The following code produces an invisible borderlayout. Swap the comments as noted and it works:
Window win = new Window();
win.setBorder("normal");
win.setPage(page);
win.appendChild(new Label("Window"));
Borderlayout layout = new Borderlayout();
layout.setWidth("100%");
layout.setHeight("100%");
win.appendChild(layout);
East east = new East();
layout.appendChild(east);
east.appendChild(new Label("The East"));
Center center = new Center();
layout.appendChild(center);
//center.appendChild(new Label("The Center"));
// switch below block with above line and it works
Hbox hbox = new Hbox();
hbox.appendChild(new Label("Center in Hbox"));
center.appendChild(hbox);
West west = new West();
layout.appendChild(west);
west.appendChild(new Label("The West"));
Even this doesn't work ("Window" label is visible but borderlayout isn't):
<window border="normal">
<label>Window</label>
<borderlayout width="100%" height="100%">
<east>The East</east>
<center>The Center</center>
<west>The West</west>
</borderlayout>
</window>
Any ideas?
Well, now I've reduced it to just the window and my content like so:
Window win = new Window();
win.setBorder("normal");
win.setContentStyle("overflow: auto");
win.setWidth("800px");
parent.appendChild(win);
win.appendChild(contentContainer);
Not bad, but any comments on the borderlayout visibility issue would be appreciated. Also would like to know how to tell the window to scroll to the right when new content is added to contentContainer (which is an Hbox).
Thanks.
Ok, I've got it working now by specifying the height and width for both the border layout AND the window. It seems I can't make it work without the window (by adding the borderlayout to a vbox, for example). The border layout extends past the bottom of the window, though. Anyway, all I want is an autoscroll region of some kind. I have an hbox that I keep adding stuff to, and when it fills up the screen I want a scroll bar to pop up (for the hbox, not the browser window). Is there a better way to do this?
Asked: 2008-08-12 18:33:22 +0800
Seen: 281 times
Last updated: Aug 12 '08