wood burning stoves 2.0*
The moose likes Struts and the fly likes How to send back list of values from child window to parent window? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to send back list of values from child window to parent window?" Watch "How to send back list of values from child window to parent window?" New topic
Author

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

Simar Suvir
Greenhorn

Joined: Jul 29, 2011
Posts: 11

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

Joined: Mar 10, 2010
Posts: 122

Same or different action? Use session ...
Simar Suvir
Greenhorn

Joined: Jul 29, 2011
Posts: 11

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

Joined: Mar 10, 2010
Posts: 122

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

Joined: Aug 12, 2011
Posts: 41

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.


Coderanch, best ever forum on the net. Hands down.
Durga Kannan
Greenhorn

Joined: Mar 18, 2011
Posts: 19

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

Joined: Jan 30, 2011
Posts: 329

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]?


Have Fun with Java
little,little.. little by little makes a lot..
Durga Kannan
Greenhorn

Joined: Mar 18, 2011
Posts: 19

@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

Joined: Jun 27, 2012
Posts: 55

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.


Take up one idea. Make that one idea your life; dream of it; think of it; live on that idea. Let the brain, the body, muscles, nerves, every part of your body be full of that idea, and just leave every other idea alone. This is the way to success.
 
 
subject: How to send back list of values from child window to parent window?