• 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Passing values from child to parent window

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Collin,

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


Regards,
Kartik
 
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic