File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Refreshing parent window

 
Sathwik Raju
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am working on a web application where I am using parent/child windows. My application has one main window and some buttons like for adding new record, modifying new record etc. When user clicks on any button a child window opens where user enters data and upon clicking save/update button there, the page gets submitted within the child window giving him message whether save/update is successful or not. Now when he closes the child window I would like to refresh the parent window which maintains list of added records. Note that child window is not a modal window and resubmission of page is happening within the window.

I could achieve this if the child window is a modal window and if there is no resubmission of the page within the child window.
In body I am calling this function on unload

function refreshParent()
{

var xWin=window.dialogArguments;
xWin.location.replace(xWin.location);
}

In a nutshell I would like achieve this

1. Open non-modal child window with some fields for user to enter, when any button is clicked in parent window
2. Page should get submitted within the child window upon clicking save/update button showing some message
3. Upon closing child window the parent window should get refreshed.

Can anyone help me out.

Thanks in advance

Regards,
Sathwk
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is really more of an HTML question than a JSP one.

You can use window.opener to get a handle on the main browser instance.
'Parent" is a term used in a frame/frameset relationship.
 
Murali Banda
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
some web sites suggest this code:
window.opener.document.reload(), but I couldnt get it to work.

However, the following code works:
window.opener.document.location.href="url of the page".
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
modal window:

parent window

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic