-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I am trying to close the current window using zk and mvvm. I call my java code but do not know how to refrence to the current page or if I got the reference how to close it.
Can somebody help me?
Thanks in advance for the advice!
We have 2 ways to close the modal window.
1- Taking property and set visiblity of page to false & true.
In zul file
<groupbox mold="3d" height="70%" visible="@load(vm.showDialog)" ></groupbox>
In class,
private boolean showDialog = true; // to show the dialog public void getShowDialog(); public void setShowDialog(boolean showDialog);
@NotifyChange("showDialog ") public void cancel() { showDialog = false; // to close the modal window }
2- Wiring the window id in java class and use detach() method to close it.
Eg.
In zul file
<groupbox mold="3d" height="70%" id="grpID"></groupbox>
In java class,
@Wire Groupbox grpID; public void cancel() { grpID.detach(); // to close the window }
Check here
Asked: 2013-01-19 23:52:11 +0800
Seen: 162 times
Last updated: Feb 04 '13
isn't
self.detach();
in the java part working as well? just wondering
frant ( 2013-01-21 08:00:26 +0800 )editI am sorry but I guess I should have been more specific, I need to close the browser window/tab/subprocess or if I were to close the "window" my page does not have a window only a <page> and border layouts. Is there any way to do either of these?
mo411 ( 2013-01-21 14:14:17 +0800 )editIf you want to close browser window, it is not related to MVVM, please use "window.close()" function in javascript. Furthermore, you can execute javascript with Clients.evalJavaScript() API in java class.
vincentjian ( 2013-01-23 09:05:30 +0800 )editThis is a long time pending feature from ZK.
Senthilchettyin ( 2013-01-29 05:35:36 +0800 )edit