0

Can close a window with zk? [closed]

asked 2013-01-19 23:52:11 +0800

mo411 gravatar image mo411
18

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!

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by sjoshi
close date 2013-02-08 05:56:48

Comments

isn't

self.detach();

in the java part working as well? just wondering

frant ( 2013-01-21 08:00:26 +0800 )edit

I 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 )edit

If 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 )edit

This is a long time pending feature from ZK.

Senthilchettyin ( 2013-01-29 05:35:36 +0800 )edit

3 Answers

Sort by ยป oldest newest most voted
7

answered 2013-01-21 06:50:13 +0800

psingh gravatar image psingh flag of India
963 8

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
}

link publish delete flag offensive edit
0

answered 2013-01-20 04:22:47 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2623 3 8
http://emrpms.blogspot.in...

Check here

link publish delete flag offensive edit
0

answered 2013-02-04 19:41:44 +0800

kazma gravatar image kazma
15 3

put this code in your controller and it should do the trick

@Listen("onClick = #close") public void close (){

    subWin.detach();
}
link publish delete flag offensive edit

Question tools

Follow

RSS

Stats

Asked: 2013-01-19 23:52:11 +0800

Seen: 162 times

Last updated: Feb 04 '13

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