?
Solved

Need to handle close event of window without any alert message

Posted on 2007-11-17
5
Medium Priority
?
1,323 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 672 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 664 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 664 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

752 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