• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Refreshing parent window

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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".
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
modal window:

parent window

Eric
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic