0

onClose page

asked 2011-01-19 10:52:19 +0800

Neus gravatar image Neus
1415 14

Hi,

How can I do something when a page is closed?

I want to free a conection but only in one single page not in all pages of my project.

Any idea?

Thank you!

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2011-01-19 18:31:36 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

can you explain more about " free a conection" ?

link publish delete flag offensive edit

answered 2011-01-20 02:48:25 +0800

Neus gravatar image Neus
1415 14

When a user open this page he can connect to another PC. I have a button to close that connection but the user have the possiblity to close the page with the navigator button and the connection will remain open. So I have to do something to free it when user closes the page.

Don't know if I'm explaining it OK...

Thank you!

link publish delete flag offensive edit

answered 2011-01-23 06:29:10 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

you can monitor the desktop can close the connection after it was destroyed by closing of the browsers

link publish delete flag offensive edit

answered 2011-01-24 02:02:15 +0800

Neus gravatar image Neus
1415 14

So, it means I have to use DesktopCleanup?

link publish delete flag offensive edit

answered 2011-02-14 09:04:30 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

yes, you can use
http://books.zkoss.org/wiki/ZK_Configuration_Reference/zk.xml/The_listener_Element/The_org.zkoss.zk.ui.util.DesktopCleanup_interface

or try onOpen on the component (it will fire OpenEvent which contains the close info)

link publish delete flag offensive edit

answered 2011-02-14 09:23:56 +0800

Neus gravatar image Neus
1415 14

Now I'm using DesktopCleanup. But it is called everytime a desktop is destroyed and this action is specific for a page.
If there isn't another possibility I will remain using DesktopCleanup.
The root of my page is a borderLayout not a Window. I think it doesn't have the onOpen event. Or it have it?

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: 2011-01-19 10:52:19 +0800

Seen: 322 times

Last updated: Feb 14 '11

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