Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Passing values from child to parent window

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic