0

cleanup desktop when page refreshed

asked 2009-11-26 02:29:50 +0800

mixgho gravatar image mixgho
193 3

Hi all,

I have my DesktopCleanup class defined in zk.xml and the cleanup is correctly called when user closes the browser window. So far so good.
But when user refreshes the page, new desktop is created for him, but the old desktop is not destroyed and my cleanup method is not called.

Does anybody know how to enforce calling cleanup method even in this situation?

Thaks in advance!

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2009-11-26 21:54:03 +0800

jimmyshiau gravatar image jimmyshiau
4921 5
http://www.zkoss.org/ ZK Team

Hi,mixgho
I try it in zk 363 demo
it works well

zk.xml

<listener>
		<description>MyDesktopCleanup</description>
		<listener-class>
			ctrl.MyDesktopCleanup
		</listener-class>
</listener>

MyDesktopCleanup.java

package ctrl;

import org.zkoss.zk.ui.Desktop;
import org.zkoss.zk.ui.util.DesktopCleanup;

public class MyDesktopCleanup implements DesktopCleanup{

	@Override
	public void cleanup(Desktop arg0) throws Exception {
		System.out.println("clean");		
	}

}

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: 2009-11-26 02:29:50 +0800

Seen: 404 times

Last updated: Nov 26 '09

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