0

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

Hello,

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

Pete

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

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...
</panel>

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

Now the event listener may be something like this:

@Command("maximize-the-panel")
public void onMaximizePanel(@SelectorParam("#testPanel") Panel panel) {
   panel.setMaximized( !panel.isMaximized() );
}

Hope that helps

Costas

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

Follow
1 follower

RSS

Stats

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