-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, I have implemented a DesktopCleanup in my application indicating the DesktopCleanup class in my zk.xml
But now, I have a page where I have to do something more when the page is closed. How can I do it?? The application DeskopCleanup must be executed beacuse it has generic cleanups but I need something more specific also.
Thank you!
Another solution to your problem might be to use native javascript like this:
window.addEventListener("beforeunload", function (e) {
/* call a servlet to do a job */
});
Take care that in this function you cannot make use of zAu.send(event) because the ViewModel (or the controller) is not "listening" anymore, but you may call a servlet to do anything you want.
Hope that helps
Costas
I think you need only one DesktopCleanup implementation, and switch to different cases in it.
You got a reference to the Desktop in the implemented cleanup() method. According to that you can program different behaviors. I am not a ZK expert, I guess you can set some attribute on your ZUL files or Controllers, and then you can read this argument in the cleanup method. So you will known, from which page is just closing.
Asked: 2014-10-03 10:09:12 +0800
Seen: 10 times
Last updated: Oct 03 '14