0

Proportional sizing of BorderLayout

asked 2011-02-07 01:32:24 +0800

giordan gravatar image giordan
48 2

I'm using ZK 5.0.5.
Our project follows the MVC paradigm where each zul file has a window as main container and that exploits "wire variables" and "auto forward".
In this context, I have a BorderLayout inside the window that serves as the main container of a file of Zul. I would like to size the BorderLayout so that it has the same window size, which in turn are proportional to those of the screen.

To accomplish this I have tried to use all the solutions described in the thread http://www.zkoss.org/forum/listComment/11037/1/20 without luck.

In any case, I think that it might be the case to modify the BorderLayout component to improve its control.
What do you think about it?

Please, somebody help me to solve the problem of proportional sizing of BorderLayout.

Thanks a lot in advance, best regards,

Giordano

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2011-02-07 08:27:28 +0800

xmedeko gravatar image xmedeko
1031 1 16
http://xmedeko.blogspot.c...

You can have a borderlayout or any component as a root component and wire variables in the controller as you are used to with the window. The window just makes it's own ID space, which might be usefull.

link publish delete flag offensive edit

answered 2011-02-07 09:19:32 +0800

giordan gravatar image giordan
48 2

Thanks for your answer.

If I understand it, you suggest the following:
1. eliminate the window as root component of the file zul
2. do become the borderlayout the root component of the zul file
3. its controller will extend the BorderLayout, not the window that no longer exists

I'm very sad: I've tried it but not work.

link publish delete flag offensive edit

answered 2011-02-07 15:17:27 +0800

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

updated 2011-02-07 15:18:01 +0800

it should work:


not tested:

public class YourBorderLayoutController extends Borderlayout implements AfterCompose {

  . . .

       @Override
	public void afterCompose() {
	
		Components.wireVariables(this, this); // auto wire variables
		Components.addForwards(this, this); // auto forward
	}
}

link publish delete flag offensive edit

answered 2011-02-08 01:18:29 +0800

xmedeko gravatar image xmedeko
1031 1 16
http://xmedeko.blogspot.c...

Hi giordan,
I guess you use:
<borderlayout use="com.my.MyBorderLayout" ...>

I thimk you should better use Composers
<borderlayout apply="com.my.MyMainComposer" ...>

see GenericForwardComposer.html

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: 2011-02-07 01:32:24 +0800

Seen: 168 times

Last updated: Feb 08 '11

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