Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to handle showModal dialog's X button?  RSS feed

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers,
I am using window.showModalDialog in my application,in that when submitted an action, the process takes some time to complete successfully,during the process the user is closing the window,by clicking dialog's "X" button.

How can I avoid user to use 'X' button, I want user to wait until the process completes,at present a Please wait...screen is being shown,but that is not useful as he closes the window using 'X' button.

Iam eagerly looking for some really good solution,
Thank you friends.

ramana.
 
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not block it.

Have you looked into onbeforeunload?

Eric
 
Ramna Reddy
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,
First of all,
For all:Wish you happy new Year

Yes Eric,I have seen onbeforeunload,I knew,we can't restrict user of his rights.But, I am asking any alternative solution for this kind of problem?
anybody might have faced this,I would like to know,how they solved?

thanks,
ramana.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing you can really do other than stand there and hold the user's hand.

You can avoid modal windows and use an iframe in the parent page. Absolutely position it and do your work in there.

Eric
 
Ramna Reddy
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The reason for using Modal window is not to give access to underlying parent window.

ramana
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!