0

North in Borderlayout does not resize

asked 2012-11-01 23:18:18 +0800

zhvihti gravatar image zhvihti
12

Hi all,

Is it possible to make North automatically expand (vertically) when expanding/adding content?

Here is a ZK Fiddle example

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.

delete flag offensive retag edit

2 Replies

Sort by » oldest newest

answered 2012-11-02 20:57:10 +0800

twiegand gravatar image twiegand
1807 3

updated 2012-11-02 20:57:41 +0800

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

link publish delete flag offensive edit

answered 2012-11-04 21:41:11 +0800

zhvihti gravatar image zhvihti
12

Thanks a lot Todd,

This is great and really shows the flexibility of ZK :)

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: 2012-11-01 23:18:18 +0800

Seen: 86 times

Last updated: Nov 04 '12

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