-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
I'm using zk8.5.0. I have a Toggle Popup bound with a button and I want to handle onOpen events of my Popup. But when I start to listen to onOpen events then toggle mode stops working and Popup don't closing on second click to the button.
Simple example of zul and viewModel:
example.zul
<zk>
<window viewModel="@id('vm') @init('pkg$.MyViewModel')">
<button label="Button" popup="examplePopup, type=toggle"/>
<popup id="examplePopup" onOpen="@command('handleOpenEvent')">
<label value="example popup"/>
</popup>
</window>
</zk>
MyViewModel.java
public class MyViewModel {
@Command
public void handleOpenEvent(@ContextParam(ContextType.TRIGGER_EVENT) OpenEvent event) {
//some event handling
}
}
You can see how it works on zkfiddle: zkfiddle.org/sample/34ft7km/1-Toggle-Popup-not-closing
Actually, the question:
How can I handle OpenEvent of the Popup without changing proper Toggle Popup behavior?
Аdditional information:
During debugging I've found following behavior:
2 | No.2 Revision |
I'm using zk8.5.0. I have a Toggle Popup bound with a button and I want to handle onOpen events of my Popup. But when I start to listen to onOpen events then toggle mode stops working and Popup don't closing on second click to the button.
Simple example of zul and viewModel:
example.zul
<zk>
<window viewModel="@id('vm') @init('pkg$.MyViewModel')">
<button label="Button" popup="examplePopup, type=toggle"/>
<popup id="examplePopup" onOpen="@command('handleOpenEvent')">
<label value="example popup"/>
</popup>
</window>
</zk>
MyViewModel.java
public class MyViewModel {
@Command
public void handleOpenEvent(@ContextParam(ContextType.TRIGGER_EVENT) OpenEvent event) {
//some event handling
}
}
You can see how it works on zkfiddle: zkfiddle.org/sample/34ft7km/1-Toggle-Popup-not-closing
Actually, the question:
How can I handle OpenEvent of the Popup without changing proper Toggle Popup behavior?
Аdditional information:
During debugging I've found following behavior:
3 | No.3 Revision |
I'm using zk8.5.0. I have a Toggle Popup bound with a button and I want to handle onOpen events of my Popup. But when I start to listen to onOpen events then toggle mode stops working and Popup don't closing on second click to the button.
Simple example of zul and viewModel:
example.zul
<zk>
<window viewModel="@id('vm') @init('pkg$.MyViewModel')">
<button label="Button" popup="examplePopup, type=toggle"/>
<popup id="examplePopup" onOpen="@command('handleOpenEvent')">
<label value="example popup"/>
</popup>
</window>
</zk>
MyViewModel.java
public class MyViewModel {
@Command
public void handleOpenEvent(@ContextParam(ContextType.TRIGGER_EVENT) OpenEvent event) {
//some event handling
}
}
You can see how it works on zkfiddle: zkfiddle.org/sample/34ft7km/1-Toggle-Popup-not-closing
Actually, the question:
How can I handle OpenEvent of the Popup without changing proper Toggle Popup behavior?
Аdditional information:
During debugging I've found following behavior: