Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using javaScript onbeforeunload method in JSF application  RSS feed

 
Srikanth Rachakonda
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

i have .xhtml file. if data is modified in the form and then if user tried to navigate to any other page. i need to show one conformation dialog box like "Are you sure really want to leave ?". This requirement should work in IE8 browser.

1. i used the onbeforeunload method in javascript. It shows conformation dialog box gracefully before leaving the page but if i click on cancel button in that conformation dialog box it freezing the UI screen.
Eg:



Please suggest me on this issue.. it really made me mad.


 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Srikanth!

This event has many quirks. I recommend that you read this:

https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload
 
Srikanth Rachakonda
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

Thank you very much Tim for resonding. i used that implementation. but in ie8 it showing dialog box what i mentioned. but i f i click on yes button in showing browser spefic window like clicked to want to navigate or not. just like we get dialog boxs which appear in all online banking accounts.


Thanks & Regards,
Srikanth R
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need some help in translating that into English. I can't understand it.

IE 8 does have some significant issues with JavaScript, so I recommend checking the Microsoft IE8 JavaScript documentation. But Microsoft is going to totally drop support for Internet Explorer 8 in about 2 months (February 2016).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!