wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Passing values from child to parent window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Passing values from child to parent window" Watch "Passing values from child to parent window" New topic
Author

Passing values from child to parent window

Collin Dugas
Ranch Hand

Joined: Jul 10, 2009
Posts: 91
Hi All,

I have a requirement in which on click of a Assign button(Parent JSP containing a Text box and Assign button) a new child window(Child JSP) opens up displaying a list of values to select from. On selecting values and submitting the form the child window should close and the parent window be populated with the selected values.

I have been trying it for some time but could not do it. I would appreciate if anyone share any info if they have worked on this, any idea if this can be done or if the UI needs to be changed?

Thanks
James Ward
Ranch Hand

Joined: Apr 27, 2003
Posts: 263
Collin Dugas wrote:Hi All,

I have a requirement in which on click of a Assign button(Parent JSP containing a Text box and Assign button) a new child window(Child JSP) opens up displaying a list of values to select from. On selecting values and submitting the form the child window should close and the parent window be populated with the selected values.

I have been trying it for some time but could not do it. I would appreciate if anyone share any info if they have worked on this, any idea if this can be done or if the UI needs to be changed?

Thanks


There can be several ways using javascript/jsp:

You can refresh the parent window using javascript from the child(popup window)


This technique can work, if your child window sends that data to server, and parent window while refreshing can retrieve it from the server.



You can pass the selected values from child window to parent window using javascript:

Make sure your parent window has a javascript function called setValues(...)


Collin Dugas
Ranch Hand

Joined: Jul 10, 2009
Posts: 91
I got the solution on googling. It was a simple solution and I apolozise for posting such trivial questions. Will make sure to try out all things before asking for help here from now.
Thanks you
Kartik Talasu
Ranch Hand

Joined: Aug 21, 2009
Posts: 98
Hi Collin,

Could you share the link with me as even i needed the same logic for my application.


Regards,
Kartik
 
wood burning stoves
 
subject: Passing values from child to parent window
 
Similar Threads
Add and Edit a row
input from a new window
Update Value from a child window
How to persist data of child window form
error in passing values from child window to parent window