-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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
Asked: 2014-09-22 15:40:37 +0800
Seen: 12 times
Last updated: Sep 22 '14