• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Communication between Child and Parent Window

 
ShivPrakash Srivastava
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64958
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Subhadip Chatterjee
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
ShivPrakash Srivastava
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Thanks very much to all of you.

Regards
Shiv
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic