-
FEATURED COMPONENTS
First time here? Check out the FAQ!
At one point I had figured this out, but can't find my old code. I need to get a callback whenever the user navigates away from my page - which means going to a different url, closing the browser tab or browser, basically anything. I need to do some cleanup whenever they leave my page. I will keep looking for my old code and post it if I find it, but in the meantime if anyone knows help appreciated.
Thanks+
Found it - use the DesktopCleanup interface. You also need to let ZK know who to call for
this via zk.xml :
public class MyDesktopCleanup implements DesktopCleanup { public void cleanup(Desktop desktop) { // put your code here to be called when user leaves page } }
And in zk.xml
<listener> <description>Called when the ZK Desktop is detroyed</description> <listener-class>com.foo.MyDesktopCleanup</listener-class> </listener>
Asked: 2008-12-08 14:25:18 +0800
Seen: 199 times
Last updated: Dec 08 '08