-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
Is it possible to make North automatically expand (vertically) when expanding/adding content?
Click the button and observe how by increasing the vlayout spacing, North clips the items, pushing the button out of view. Borderlayout.resize() does nothing. No combination of flex, vflex ("true"/"min"), or CSS overflow on North, the other parts, the div, and the vlayout worked.
The only way to see the content seems to be scrollable/splittable (therefore requiring user action). I need this for the header in an app where the user can add toolbars which should push West/Center/East down.
Any help appreciated.
Thank you.
zhvihti,
You can fix this by wiring up the north component like you did your vlayout. Then, call invalidate() on that component. I modified the composer from your ZK Fiddle example to look like this:
TestComposer.java
import org.zkoss.zk.ui.*; import org.zkoss.zk.ui.event.*; import org.zkoss.zk.ui.util.*; import org.zkoss.zk.ui.ext.*; import org.zkoss.zk.au.*; import org.zkoss.zk.au.out.*; import org.zkoss.zul.*; public class TestComposer extends GenericForwardComposer{ Vlayout vl; North north; public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); } public void onClick$btn(Event e) throws InterruptedException{ //Messagebox.show("Hi btn"); vl.setSpacing("20px"); north.invalidate(); } }
That should do the trick.
Regards,
Todd
Asked: 2012-11-01 23:18:18 +0800
Seen: 86 times
Last updated: Nov 04 '12