-
FEATURED COMPONENTS
First time here? Check out the FAQ!
@Command
@NotifyChange({ "currentPost", "winvisible" })
public void doAdopt() {
Messagebox.show("sure?", "make sure",
new Messagebox.Button[] { Messagebox.Button.OK, Messagebox.Button.CANCEL }, Messagebox.QUESTION,
new EventListener<ClickEvent>() {
@Override
public void onEvent(ClickEvent event) throws Exception {
if (Messagebox.Button.OK.equals(event.getButton())) {
//do somthing here ,if success:
setWinvisible(false); //failed to hide my window.and got null exception atfer this executed, and click component in the window.
} else {
//do something
}
}
}
});
if (.........)
setWinvisible(false); //success, and this executed before user response the messagebox.
}
hello, I'm using MVVM, and failed to hide my window in the even listener. any suggestion ?
inside the event listener (which is not an MVVM command handler) method you have to trigger the notify change programmatically.
if (Messagebox.Button.OK.equals(event.getButton())) {
//do something here, if success:
setWinvisible(false);
BindUtils.postNotifyChange(null, null, YourViewModelClass.this, "winvisible");
} else {
//do something
}
Asked: 2018-10-22 17:21:20 +0800
Seen: 5 times
Last updated: Oct 23 '18
[Announcement] ZK 8.5.1 is now available!
Highlight new release changes/new features in demo app
How can I make a button change its image by clicking on the same button?
Problems calling function 'sec:isAnyGranted' with zkspring 3.2 and Spring Security 4
webapp folder of ZK spring boot?
Can I set in runtime a new value to library property: org.zkoss.zk.ui.processMask.enabled:
Package ZK Eclipse Tomcat Project For Deployment
AImage org.zkoss.zk.ui.UiException: java.io.FileNotFoundException