aspose file tools*
The moose likes Struts and the fly likes How to store and bind to the view containing multiple values for single field? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to store and bind to the view containing multiple values for single field?" Watch "How to store and bind to the view containing multiple values for single field?" New topic
Author

How to store and bind to the view containing multiple values for single field?

Nagaraj Shivaklara
Ranch Hand

Joined: Dec 16, 2008
Posts: 75
Hi,

Can you please let me know how to save and bind the multiple values for a single field? For example, i have a form with field 'Interested in' and user can select more than one values, in this scenario how do i save the values and how to bind again to the view? what is the best design for this? I am using struts 2.

Similar scenario is like user will select multiple select boxes and i have to persist them and again i have to show the selected boxes in view..


Thanks
Nagaraj

Thanks n Regards,
Nagaraj S K
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3378
    
    9
You probably want a JList. Read the documentation to find out how you can select and get multiple values.
Nagaraj Shivaklara
Ranch Hand

Joined: Dec 16, 2008
Posts: 75
Hi,

I dont want use swings or awt components..

Stephan van Hulst wrote:You probably want a JList. Read the documentation to find out how you can select and get multiple values.
Nitin Surana
Ranch Hand

Joined: Jan 21, 2011
Posts: 129

This is all you need.

http://www.mkyong.com/struts2/how-to-set-default-value-for-multiple-checkboxes-in-struts-2/

If you don't get it, let me know. I'll write another example.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to store and bind to the view containing multiple values for single field?
 
Similar Threads
Select Values
Need Script
What type of listener can i use, instead of FocusListener
Problem while Navigation in Struts.
Multiple forms with Use bean.