Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to send back list of values from child window to parent window?

 
Simar Suvir
Greenhorn
Posts: 11
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirement where I have to select values(multiple rows of values) from a child window and send them back to the parent window.

Kindly guide how can I achieve this?
 
Jesus Mireles
Ranch Hand
Posts: 122
IntelliJ IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same or different action? Use session ...
 
Simar Suvir
Greenhorn
Posts: 11
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is through the same action that it has to be carried out. The thing is we have a parent window where we have a field "NAME". This is a select button field upon which opens a child window where we need to select multiple rows. On the selected basis the NAME field and few other fields in the parent window shall get populated.

We could manage to get the child window open by clicking the select button next to NAME field and also could able to pull in the values from database. Now the challenge for us is to send back the selected rows of values back to the parent window fields.

Kindly guide us through.
 
Jesus Mireles
Ranch Hand
Posts: 122
IntelliJ IDE Java Mac
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you need to persist somewhere. So you either persist to your database or to session.. You can probably add some JavaScript that forces a window refresh so that he parent can go and re-retrieve any persisted data.

It may be better to use modals than opening a new window and then you can probably just use JavaScript.
 
Orton K Randy
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What Jesus Mireles said. I would have used session to backup the user selected data but that's up to you. The usage of a new window for collecting specific user input is quite common now although I hate it for the most part from user POV.
 
Durga Kannan
Greenhorn
Posts: 19
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am also having 2 jsp's. 1 is parent & other is child. I want to pass the selected values from child to parent page.
I tried using request.getParameter,tat didn't work. Could anybody give me some suggestion to get the values passed from child to parent window?

Any suggestions would be highly appreciated. .

Is this can be achieved through using "href" in javascript.

Thanks all in advance!!
 
Shankar Tanikella
Ranch Hand
Posts: 329
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Durga Kannan wrote:Is this can be achieved through using "href" in javascript
No
Durga Kannan wrote:I tried using request.getParameter,tat didn't work
This approach should work, what did you do and what is the problem you are facing?

However, I prefer what Jesus Mireles have suggested. Did you try that [usig session]?

 
Durga Kannan
Greenhorn
Posts: 19
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Shankar : Thanks for your reply. I managed to get the value passed from 1 jsp to other page.
Thanks all for your suggestion.

Now i trying to read some values from property file to JSP page. Could you please suggest how to achieve this?


Thanks in advance!!!
 
Sandy Chatterjee
Ranch Hand
Posts: 55
Hibernate Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This can be done in various ways.
If you are using struts1 you can use

to display any message from properties file.
Also if you want to display an image

Depends on what you want to display.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic