0

How to perform cleanup upon window closing

asked 2008-12-14 16:14:28 +0800

cvarona gravatar image cvarona
554 1 6

Hi there,

I'm trying to use a DesktopClean in my zk.xml in order to perform cleanup when the user closes the current browser window. In fact I'd rather be able to specify some cleanup code via Clients.confirmClose, but it's unfortunately impossible. I tried then to use DesktopClean, but quite as a surprise it seems not to be invoked when the browser window is closed, it only works if the user reloads the page or I redirect him to another url upon his pressing some button or link.

Is there any way to achieve the desired effect?

With kind regards

César Varona

delete flag offensive retag edit

4 Replies

Sort by » oldest newest

answered 2008-12-15 06:11:29 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

Which browser and version you are using?

link publish delete flag offensive edit

answered 2008-12-15 07:29:37 +0800

cvarona gravatar image cvarona
554 1 6

I'm using ff 2.0.0.18 and zk3.5.2,

link publish delete flag offensive edit

answered 2008-12-15 09:42:58 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

The behavior change from browser to browser so it is not a good idea to "expect" a "real time" desktop clean up. e.g. Opera and Safari will not call DesktopClean "immediately" even when you press F5 or visit to another URL. FF works on F5 and change URL but not when close the browser window.

However, the DesktopCleanup will be "finally" called when the ZK engine "kick" inactive desktops out the internal session cache.

link publish delete flag offensive edit

answered 2008-12-15 10:21:00 +0800

cvarona gravatar image cvarona
554 1 6

I think you're right, even with the same browser I'm experiencing different behaviours (sometimes DesktopCleanup gets actually invoked upon closing the browser window, sometimes not).

Thanks for taking the time to research this issue all the same

With kind regards

César Varona

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: 2008-12-14 16:14:28 +0800

Seen: 454 times

Last updated: Dec 15 '08

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