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

refresh parent window on child window close

 
rich werth
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a window that opens another window. When the child window closes I want to refresh the contents of the parent. Is there a way I can do this?
Thanks
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make a javascript function e.g. Relaod() on the parent page that just calls 'window.location.reload()'
On the child page you can make a javascript function e.g. named Close() that calls the function on the parent page like this: opener.Reload(). This function should be called when the child window closes.
/Rene
[ July 01, 2002: Message edited by: Rene Larsen ]
 
rich werth
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks rene
I have a question though because it isn't working. Inside the child window I am calling a servlet and forwarding jsp data into there. The user does some stuff finishes and ends up with an html page that says "good job u did ur thing" press here to close. so i add the function to close the window but thre reload function doesn't get calledon the parent. is this bcuz we use netscape or because the parent changes becuase i am switching btwn jsp servlet to an html page?
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:
Parent

popup

/Rene
 
rich werth
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Didn't work. No alert message either.
This is the parent

This is the child
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just tried to call a HTML page, from this page I opened a popup witch had a link to a Servlet that returned the result via RequestDispatcher.forward() to a JSP page. On this page I made a link to call the parent window to reload the page and then close.
I did it in Internet Explorer 6, Netscape 4.79 and Netscape 7.0
It works for me without any problems...
Try to post your code
/Rene
 
Yuriy Fuksenko
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it very machine/browser dependandt.
At least for IE sometimes it closes your popup before actually reloading opener window. (may be it sounds silly, but I really had it more than ones).
try to put some delay before you call self.close().
setTimeout("self.close()",100);
 
vivek shankare gowda
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way to call self.close(); completely after it reloads..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic