0

Closing window initiated in JSP

asked 2006-09-08 22:15:23 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3906181

By: herbison

What do I do in cancel to get win1 to close?
Can I have zk directives in JSP?

If I create a window in JSP:
<html xmlns:x=http://www.potix.com/2005/zul
xmlns:zk="http://www.potix.com/2005/zk">
<?page id="mainpage"?>
<x:window id="win1" border="none">
<x:caption label="<%=title%>" />
<x:include src="zk.zul" />
</x:window>
</html>

Here is zk.zul:
<?xml version="1.0" encoding="UTF-8"?>
<?taglib uri="/WEB-INF/tld/web/core.dsp.tld" prefix="c" ?> <?page id="userList"?> <window id="win2">

void cancel()
{
??????
}

<zscript src="zulUtility.java"/>
<zscript src="userList.java"/>
<grid>
K
<button onClick="cancel();" />
K.
</rows>
</grid>
</window>


delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2006-09-08 22:50:12 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3906223

By: simon_massey

i have added a whole section to the how-to wiki at http://en.wikibooks.org/wiki/ZK/How-Tos that covers "# 3.2 Struts + Tiles + JSP (+ Spring)". i don't recommend using the servlet filter. i recommend that you refactor based on the new How-Tp in the wiki that explains how to use Tiles and to put ZUL into one part of the tile.


link publish delete flag offensive edit

answered 2006-09-11 13:43:53 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3909081

By: herbison

This was easier than I expected. All I had to do is add a little html in the zk code!
<h:input width='100%' class='button' type='button'
onclick='window.close()'>Cancel</h:input>


link publish delete flag offensive edit

answered 2006-09-12 03:57:20 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3910120

By: henrichen

Do not do it this way. Your html button javascript code might close the window on the browser but server have no idea that have happened. So the state between browser and server is inconsistent. The consequence is unpredictable.

You can add zscript into your jsp page with <zk:zscript> ..
</zk:zscript>




link publish delete flag offensive edit

answered 2006-09-12 20:09:31 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3911284

By: herbison

Yes, I know about using the zk:zscript in jsp but my problem is how to close the browser window from the zscript without having to take a crash course in struts and tiles. Is there a zk command that sends a message to the browser to close?

link publish delete flag offensive edit

answered 2006-09-15 03:10:43 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3914953

By: henrichen

Window win1 = Path.getComponent("//mainpage/win1");


link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2006-09-08 22:15:23 +0800

Seen: 394 times

Last updated: Sep 15 '06

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