File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes data submit on popup and refresh parent page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "data submit on popup and refresh parent page " Watch "data submit on popup and refresh parent page " New topic

data submit on popup and refresh parent page

Bhavin Sanghani
Ranch Hand

Joined: Dec 17, 2003
Posts: 67

I want to submit data on popup, save it, close popup and show the saved data on parent page. I am using struts 1.3 environment. I tried using following ways:

1) Using Javascript, I submitted form data from popup and reloading parent page. This reloads parent page but it seems that it does not give surity of processing transaction successful. Any idea whether this approach is appropriate?

2) Using Struts, end of the "saveAction" of popup, I am forwarding it to "editAction" of parent page with expectation to bring the data and show it on the parent page. But this does not work. Any idea how it works in Struts?

Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
I usually use option 1, but inorder to make sure that pop up window saves correctly I don't close it until after the application server returns a response to the pop up window indicating that the save was successful. I do this through an onload event in the body tag.

I use javascript to repopulate the parent page but relying on js always makes me a little uneasy since you lose some control by letting it process on the client side. You may be able to reduce the amount of js you use by having the parent submit its form when the user returns from the popup and then doing your look ups on the application server where you have more control (my mother in law says I have control issues, maybe she's right). The reason I don't usually do this is for performance, its less processing on the part of the applicaiton server.
subject: data submit on popup and refresh parent page
It's not a secret anymore!