0

How to know popup is still open or already close?

asked 2013-07-10 06:00:07 +0800

dendwi gravatar image dendwi
0

How to know popup is still open or already close?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-07-10 07:08:20 +0800

cor3000 gravatar image cor3000
4332 1 7
ZK Team

just register the onOpen event it will also fire when the popup closes.

here a very simple example for a popup being used as a tooltip printing the open state to the console:

<label value="hover" tooltip="pop"/>
<popup id="pop" onOpen='System.out.println("popup open: " + event.isOpen());'>popup text
</popup>

Of course you can listen to this event in a Composer or send a command to a ViewModel.

in Composer (MVC)

@Listen("onOpen=#pop")
public void onPopupChanged(OpenEvent event) {
  if(!event.isOpen()) {
    System.out.println("popup closed");
  }
}

in zul File (MVVM)

onOpen="@command('popupChanged', open=event.open)"

in ViewModel

@Command("popupChanged") 
public void onPopupChanged(@BindingParam("open") boolean open) {
  if(!open) {
    System.out.println("popup closed");
  }
}
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: 2013-07-10 06:00:07 +0800

Seen: 31 times

Last updated: Jul 10 '13

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