Toggle Popup not closing

asked 2020-07-23 18:21:22 +0800

kaduk gravatar image kaduk
3 3

updated 2020-07-23 18:24:14 +0800

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:


  <window viewModel="@id('vm') @init('pkg$.MyViewModel')">
    <button label="Button" popup="examplePopup, type=toggle"/>
    <popup id="examplePopup" onOpen="@command('handleOpenEvent')">
      <label value="example popup"/>


public class MyViewModel {
  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:

  1. Click to the button - Popup is opened, OpenEvent(isOpen=true) is generated
  2. Press the button again (but don't release) - Popup is closed, OpenEvent(isOpen=false) is generated
  3. Release the button - Popup is opened again, OpenEvent(isOpen=true) is generated
delete flag offensive retag edit

1 Answer

Sort by » oldest newest most voted

answered 2020-07-24 11:51:13 +0800

cor3000 gravatar image cor3000
5935 2 7
ZK Team

updated 2020-11-23 10:44:32 +0800

It doesn't look like you're doing anything wrong, so I assume it's a bug and posted ZK-4628

here an idea for a workaround ...


not fully working though. since you can click anywhere else on the page to close the popup as well the close handling needs to be fine tuned a bit more.

UPDATE (2020-11-23):

A fix for ZK-4628 will be available in ZK 9.5.1 currently testable in version 9.5.1.FL.20201119(-Eval)

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




Asked: 2020-07-23 18:21:22 +0800

Seen: 10 times

Last updated: Nov 23 '20

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