File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Nagaraj Shivaklara
Ranch Hand
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Stephan van Hulst
Bartender
Pie
Posts: 4846
34
Chrome Netbeans IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably want a JList. Read the documentation to find out how you can select and get multiple values.
 
Nagaraj Shivaklara
Ranch Hand
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
Java Netbeans IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic