Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JS: closing popup from parent during onload

 
Mike Himstead
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'd like to close a popup from the parent window after the parent window does a submit. Because of several constraints I'd like to do this in the parent's onload functions. Well, my implementations doesn't work and I'd like to get some input from your:

the parent contains:


openMyWindow is called from a button.

The popup contains:



exitForm is called as a button's onclick fuction. My problem is that after returning to the parent, the searchWindow is null, so it seems as if the global variable is lost somehow. Any idea what's wrong? I'm staring at this for hours but can't find my mistake.

EDIT: added CODE tags
[ July 08, 2008: Message edited by: Mike Himstead ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along. Please read this for more information.

You can go back and change your post to add code tags by clicking the .
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you submit the parent, you destroy the window object that holds the reference to the pop up window. Therefore when the parent reloads, it can not create the reference back to the child.

Eric
 
Mike Himstead
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Duh, I thought I put it in CODE tags, sorry for that, I added them now.

Thanks for the answer, that's it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic