Solved

Need to handle close event of window without any alert message

Posted on 2007-11-17
5
1,320 Views
Last Modified: 2008-02-20
Hi Experts,

I have a main window and a pop up from the main window. I made the  popup window like ModalDialog by keeping the focus always on popup window when the user moves to main window. This is because i cannot use ShowModalDialog which will not execute some of my activeX script (this is not an issue now). I controlled all the events of main window and made the popup to behave as actual modal, But i am not able to handle the events of main window close (X), maximize and minimize. Means even though i have my focus on popup window, i am able to close the main window by clicking 'X'. Is there any way that i can handle the event of 'X' and show my popup window back. I tried 'onbeforunload' but it is asking a confirmation alert from the user. I should NOT show any confirmation from main window and i want to focus the user back to popup window if the user click 'X' of main window. I hope there is solution for this. Thanks in advance
0
Comment
Question by:jayend_expert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 168 total points
ID: 20311416
there is no way to handle system (OS) event like the window close from within a web page 'cause it violates the sandbox policy, not sure if ActiveX can do it ..
0
 
LVL 17

Assisted Solution

by:gops1
gops1 earned 166 total points
ID: 20338428
Why do not you use a customized modal
You can refer this site:
http://gabrito.com/post/enhancements-to-submodal

or google for "Submodal" and you get plenty of them
0
 
LVL 16

Assisted Solution

by:LeeKowalkowski
LeeKowalkowski earned 166 total points
ID: 20567796
"This is because i cannot use ShowModalDialog which will not execute some of my activeX script (this is not an issue now). "

- If the modal dialog won't execute some of your activeX script, then your main window won't either.  Otherwise there's nothing stopping you from putting your activeX script in your main window and invoking it from your modal dialog, but it should work in your modal dialog too, perhaps you're doing something else wrong.

--
Lee
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20943727
Forced accept.

Computer101
Community Support Moderator
0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question