aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes close child Window and reload parent window Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "close child Window and reload parent window" Watch "close child Window and reload parent window" New topic
Author

close child Window and reload parent window

AnilPrakash Raju
Ranch Hand

Joined: Jul 26, 2004
Posts: 137
Hi,

i have a parent window where a button is pressed to create a child window. In the child window i can edit and save the record. Now when i press the "Close" button(in the Child Window), i want to close the child Window and reload the parent window so it can show the latest changes.

i tried :
parent.document.location.reload();
window.close();

but it does not seem to work.

Any Suggestions


Thanks

Anil
John Smith
Ranch Hand

Joined: Sep 02, 2004
Posts: 61
define a function in the parent window called close child or some such, close the child then call reload on self. Hope this helps
AnilPrakash Raju
Ranch Hand

Joined: Jul 26, 2004
Posts: 137
Thanks for the reply.

But i tried something else in the child window:

opener.location = "http://name.com";
opener.focus();
self.close();

and it works.

But thanks for your solution


Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
Actually, I saw that issue in couple cases. From my point of view, you have to have a delay between calling reload and close, something like



My filling is that window gets closed to fast, so reload does not get a chance to start.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: close child Window and reload parent window
 
Similar Threads
error in passing values from child window to parent window
parent-child window relationship
Child window to Parent window
Passing values from child to parent window
reload Window