Queryclose on the web

I have been trying to execute some LotusScript code on the event that someone clicks on the X to close a window. Right now I have a OnBeforeUnload event which triggers another window passing it a “/hrjobprof.nsf/removelockonexit?OpenAgent&UID=” as an argument. This method is not consistent. The problem is that is doesn’t work 100% of the time.

Is there any other way to run a LotusScript agent on the event that someone simply closes the window (by the X, or File | close)…

Thanks

Remi

Subject: Queryclose on the web

If this is a problem with document locking in a Web application maybe http://www.xetrion.com can help you.

(But it works only with Internet Explorer)

Subject: Queryclose on the web

OnBeforeUnload is not universally supported by browsers. In fact, if this is in a Notes form or page (rather than an HTML form you created yourself), I don’t even know how you got OnBeforeUnload - it’s not an event Notes recognizes.

Use onUnload instead. As far as I know, you’ll need to use javascript to call your lotusscript agent.

Subject: RE: Queryclose on the web

I know that I will need to use the onUnLoad… but how do I call the agent?

Can you help me?

Remi

Subject: RE: Queryclose on the web

You’d need to call it by URL, opening it into a separate window. Note that pop-up blockers will prevent this from happening – as they SHOULD.

There is no reliable way to run code from a window close (or when the user navigates to a new URL) on the web. You cannot count on anything happening, so don’t code anything that relies on clean-up code if you can avoid it. If you can’t avoid clean-up code, then you’ll need to record a “start time” somewhere, set a time-out for a complete operation (like removing or disabling the submit button after a certain period has passed), and clean up using a sceduled agent.

Subject: RE: Queryclose on the web

The solution you suggested here is what I am using right now, and it is not working 100%… I would say 97% percent of the time… which is unacceptable.

The way you talk here, I have no other solutions…

Thanks for the responses…

Remi