473,378 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Closing child windows on Logout

15
Hi All,


I have a parent window where i have three links. On clicking those links, new window will be opened as a pop up. When i logout from the parent window, the child windows should be closed.


I can close the child windows when i close the parent window using the following code

The following function i am calling "onUnload" event in the body tag of parent window.

Expand|Select|Wrap|Line Numbers
  1. function closeDep() {
  2.  
  3.   if (win1 && win1.open && !win1.closed)
  4.    win1.close();
  5. }
  6.  
  7. function site(){
  8.  win1 = window.open('../../<%=username%>/test.jsp',''status=yes,scrollbars=1,resizable=yes,width=900,height=650');
  9. }
But i want to close the child windows, on clicking Log Out link, which is a different jsp and not the parent window page.

I am not sure whether i have posted the question in correct section or whether this should be posted in "Java" section.
Dec 12 '07 #1
5 3054
acoder
16,027 Expert Mod 8TB
Why are these windows not closed when you leave the original parent page? Do you need these open for another page?
Dec 12 '07 #2
Hey, did you find the solution?

I am having similar requirements.

Can you please post the solution here to help people like me having similar requirement.

Thanks in advancde,
Mahavir
Mar 3 '08 #3
acoder
16,027 Expert Mod 8TB
Hi Mahavir, welcome to TSDN!

Is it the same page or has the page changed since the child windows were opened? Show your code.
Mar 3 '08 #4
Thanks acoder for your reply,

Yes, the page can be and most probably changed since the chield window opened.
And yes, then the javascript wont help, because then javascript variables will loose their values.

So keeping a javascript array for chield window handles wont help.

Can we take these javascript values along with us to server trip for logout method, and while responce emmit some javascript which will take care of closing these windows? Or something like that.

Can you help something for this scenario?

Thanks,
Mahavir
Mar 5 '08 #5
acoder
16,027 Expert Mod 8TB
I haven't tested this, so it may not work, but you could try checking from the child window if the user has logged out in the parent window. Check periodically using setInterval().
Mar 5 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Ron L | last post by:
I have an MDI application with a number of child windows. In each child window I am catching the Closing event and having the child window decide if it should set cancel to true. The intent here...
2
by: Ron L | last post by:
I have an MDI application which opens a number of child windows, each of which could have data in a state that needs to be saved. Each child window catches its Closing event and cancels it if the...
1
by: Chris Bruce | last post by:
In my application I need a way to distiguish between the following events: 1. When a user closes an MDI child window. 2. When the user closes the MDI parent window which subsequently closes the...
1
by: **Developer** | last post by:
When I get a closing event in a MID Child form I don't know if the child form is closing or the main form is closing. Is there a way to tell? Thank
6
by: Barry Gast | last post by:
Hi. I have an MDI Parent form with multiple child windows. When I close the parent form, the Closing events of the children forms are not executing. Do I have to close all the child forms in the...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
6
by: **Developer** | last post by:
I've been looking but can't find out how in a form Closing event to know if the closing is because the form's "X" had been clicked or the main form's "X" was clicked. That is, I need to know if...
5
by: backups2007 | last post by:
Let's say a user logs in to the system. He opens pop-up forms and then logs out. Is there a way to automatically close all child windows(pop-up windows) when a user clicks the logout button? I...
4
by: reemamg | last post by:
From a parent window a new child window is open with window.open <script type="text/javascript" language="JavaScript" > function abc() { if(window.event.clientY <0 &&...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.