wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Parent form reload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Parent form reload" Watch "Parent form reload" New topic
Author

Parent form reload

Nisha Joseph
Greenhorn

Joined: Feb 23, 2007
Posts: 1
Hi,
I'm looking to have a popup window do a submit,then close the window and reload the parent. I have seen the solution in this site as using window.open() to open popup and then in that popup use window.opener.location.reload().
This is working.

But the problem is my parent window is calling a servlet on submit. So it is showing Messagebox "Information need to resend.. retry cancel"
How can I avoid this? In this forum itself I saw one solution as using a dummy form in parent and reloading. But that is giving nullpointer exception as my servlet requires some parameters. Can someone help?
reference: http://www.coderanch.com/t/112989/HTML-JavaScript/refresh-parent-window-child-window
Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Personally, I usually manage to make it work with the 'submit form' approach. Admittedly, it might require some work.

For *some* cases, there are easy 'shortcuts':
1) If the servlet can guess 'default values' for missing parameters.
2) If the parent page already happens to include the (non-dummy) form which generated it in the first place (like 'Google' - you submit a form, and in reply you get the same form again, plus results underneath).
Then you can submit this form (provided it doesn't perform 'database write').


For more general cases, you *can* use a "dummy form", just add some *hidden parameters*.
Basically, when the servlet(or jsp) first writes the parent page, it can print a dummy form, which would preserve the original request parameters (as hidden params).
Example - assuming your param is called 'myParam' :



Now, when you decide to submit the dummy form (through javascript), it will carry the same parameter as the original request.


Hope this helps
[ February 27, 2007: Message edited by: Sol Mam-Orn ]
Pavan Kumar
Greenhorn

Joined: Jun 08, 2005
Posts: 23
You can infact call a function in the parent page using the
opener.document.Script.reloadPage(); from the popup page.. Here reloadPage() is a JavaScript function in the Parent page. You can resubmit you form in your JavaScript Function or just refresh values which you want.

Hope this helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parent form reload
 
Similar Threads
Parent window refresh problem
Problem in passing values to the parent window
Passing values from child to parent window
how to update the contents of a jsp page from another jsp
Popup form, parent form