• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP page on closing the parent window the child windows should close automatically.

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,

How will we do in JSP page on closing the parent window the child windows should close automatically.

For Example::
Suppose in the prelogin(Not Post login page) the Login page is opening.Under the Login Page suppose Contact us link are thier.
My doubt is when we close the login page then if Contact us link is open then it will automatically close.

Please advise me for the above needful.

Thanks and Regards
Sumanta Panda
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Thanks a lot to Java Ranch.I got the solution with the help of Google.
function closeWin()
{
if(window.applnreq && window.applnreq.open && !window.applnreq.closed)
window.applnreq.close();
}

Regards
Sumanta Panda
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just adding another link in case this shows up in a search.

Here is an example on closing multiple windows: http://radio.javaranch.com/pascarello/2005/01/19/1106152877000.html

[Glad you found a solution and posted it! Most people tend to not post the solution. Gold star!]

Eric
[ December 24, 2008: Message edited by: Eric Pascarello ]
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,
It is working for if the link is HTML,JSP if child link is pdf file then
the error comming Member not found.

Please i will show you my code.

For HTML link
function closeWin()
{
if(window.applnreq && window.applnreq.open && !window.applnreq.closed)
window.applnreq.close();
}
function showApplnFormWindow()
{

strURL = '<%=ApplicationStatusHTMLPath%>';
applnreq = window.open(strURL,"applnreq","height=450, width=650,scrollbars=yes,top=0,left=0,status=yes");
applnreq.focus();
}

For Pdf file i am using same code
function closeWin()
{
if(window.tradenpdfreq && window.tradenpdfreq .open && !window.tradenpdfreq .closed)
window.tradenpdfreq .close();
}
function showTradePDFWindow()
{

strURL = '<%=ApplicationStatusPath%>';
tradenpdfreq = window.open(strURL,"tradenpdfreq","height=450, width=650,scrollbars=yes,top=0,left=0,status=yes");
tradenpdfreq .focus();
}

But sir here error coming "MEMBER NOT FOUND".

Please i request anybody to rectify my code in pdf link case so that
i should not face "MEMBER NOT FOUND".

Thanks and Regards
Sumanta Panda
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When is the error happening? When you open the window or when you close it?

if it is when you open it, might be an issue with the focus() being called too soon. Try adding a setTimeout("...focus()",300);

Eric
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear SIR,
when i click the pdf link first time it is opening.
But when i click again same pdf link in login page instead focus in the same pdf file it is showing "Member not found " Java script error.

But if the link is jsp file/HTML file then same code working perfectly.

I request all of you please guide me for the needful.

Regards
Sumanta
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was able to recreate the bug in IE6. IE6 opens it up in adobe and not in a browser so you have no control over it. If you add an alert after the open statement,you will see that the browser says it is closed.



That means we loose control over this window. Only option you have in this case would be to change the second parameter in window.open to have a unique name.

Eric
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,
I did everything accoding to your advise.But still this error happening.

Dear All,
If any body knows the solution for my problem please guide me for the needful.


Thanks a lot in advance.

Regards
Sumanta
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic