Yeah, this will work but only for IE and Firefox. For other browsers
(opera, safari) there is no way to get this event i'm affraid.
-Matej
On 5/21/07, Flavius <[EMAIL PROTECTED]> wrote:
>
>
> Thanks Martijn.
>
> getBodyContainer().getBodyContainer().add(new AjaxEventBehavior("onunload")
> {
>
Thanks Martijn.
getBodyContainer().getBodyContainer().add(new AjaxEventBehavior("onunload")
{
protected void onEvent(AjaxRequestTarget target)
{
//handle cleanup here
}
});
This works well, except it doesn't fire when the browser is closed.
I'm keepi
body.onunload could be your friend
However, don't depend on this behavior to be a failsafe: kill -9 will
not trigger the body onunload in the browser, or a power failure on
the client side, or a BSOD, or ...
Martijn
On 5/18/07, Flavius <[EMAIL PROTECTED]> wrote:
>
> I would like to receive an ev
I would like to receive an event when the user tries to navigate
away from the current page.
So if the user is on the page and navigates to any other page, closes
the window, etc., I'll get an event.
I have a page that allows the user to upload files to a record. I store
the physical file in a