• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

refresh parent window on child window close

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this:
Parent

popup

/Rene
 
rich werth
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any way to call self.close(); completely after it reloads..
 
Water proof donuts! Eat them while reading this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic