Panel maximise manually (MVVM)

asked 2014-09-22 15:40:37 +0800

PeteMorgan gravatar image PeteMorgan
3 2

updated 2014-09-22 15:41:09 +0800


Is there a way to maximise a panel from one of my buttons. That is, I do not want to use the panel's maximizable="true" attribute. Instead I want the maximise button in radically different location. I've fiddled with CSS and quite honestly it is painful to move the ZK max button that way. So I was wondering if there is a way to say maximizable="false" and then add my own button somewhere and onClick have it issue a command to cause the panel to maximise. Also I'd quite like to spot if the panel is maximised and then change the button to say minimise. Worse case I can live without that and just use some generic icon that does both max and minimise.

Many thanks in advance for any assistance you can provide.

Kind regards


delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-09-22 18:08:13 +0800

cyiannoulis gravatar image cyiannoulis
1191 10

Here is a quite simple solution using the @SelectorParam.

The zul snippet may look like this:

<panel id="testPanel" border="normal" maximizable="true">
   ...panel contents...

<button label="Maximize Panel" onClick="@command('maximize-the-panel')" />

Now the event listener may be something like this:

public void onMaximizePanel(@SelectorParam("#testPanel") Panel panel) {
   panel.setMaximized( !panel.isMaximized() );

Hope that helps


link publish delete flag offensive edit
Your answer
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

1 follower



Asked: 2014-09-22 15:40:37 +0800

Seen: 12 times

Last updated: Sep 22 '14

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