• Post Reply Bookmark Topic Watch Topic
  • New Topic

Detecting page unloads ...

 
Vikas Nair
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using an attribute in APPLICATION scope for concurrency checking. The problem is, the attribute has to be reset if (and only if) the user navigates out of the page without submitting the data (say ,by clicking the BACK button in the browser) ... So ,how do i detect that?
 
David Hibbs
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would likely require the use of javascript and the onunload property of the body tag. Do your validation in a script, then set the page URL to be a page that does what you need it to do. The problem is that there's no guarantee that the JavaScript will run as you expect it to on the client's browser...
It might be best to reconsider your plan and look for alternate ways of knowing when to commit/rollback.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!