wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Communication between Child and Parent Window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Communication between Child and Parent Window" Watch "Communication between Child and Parent Window" New topic
Author

Communication between Child and Parent Window

ShivPrakash Srivastava
Ranch Hand

Joined: Mar 24, 2005
Posts: 88
Hi All,

I have a child window and I make some changes in the child window.After the changes when I close the child window,I want the parent window to be refreshed and display the changes made in the child window.Is there any way that I can refresh the parent window and display the changes?

Thanks and Regards
Shiv
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Your child window, assuming that it was opened via window.open(), has access to its parent through window.opener.
[ January 16, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Subhadip Chatterjee
Ranch Hand

Joined: Dec 12, 2006
Posts: 93
Hi there,
ya "Sheriff" is always right...hey, i can give you some sample code, which you can directly use in your application...in your child window (i mean the HTML/JSP) page just write this javascript:
window.onunload = function(){
window.opener.<parent_window_form_name>.target=''; window.opener.<parent_window_form_name>.action="<parent_window_action>";
window.opener.<parent_window_form_name>.submit();
}

The idea ro refresh your parent window is to resubmit your parent window form. So, this script in your child window will do the refresh by calling Parent through "window.opener".


Refreshing life every moment...
ShivPrakash Srivastava
Ranch Hand

Joined: Mar 24, 2005
Posts: 88
Hi

Thanks very much to all of you.

Regards
Shiv
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Communication between Child and Parent Window
 
Similar Threads
dynamic DIV tag
Popups in STRUTS
reload Window
passing the selected value back to calling page
close child Window and reload parent window