Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Refreshing parent window

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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;

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

Posts: 13411
Firefox Browser VI Editor Redhat
  • 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.
Posts: 1
  • 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".
Posts: 15385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
modal window:

parent window

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic