File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to use multiple attribute on html:select  struts tag Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark "How to use multiple attribute on html:select  struts tag" Watch "How to use multiple attribute on html:select  struts tag" New topic
Author

How to use multiple attribute on html:select struts tag

Gordon Campbell
Greenhorn

Joined: Sep 27, 2004
Posts: 1
I hope someone can help with this problem.

I have a select box that has a list of items contained in it and the user can select multiple values.



The property 'software' is a java.lang.String[] property from a form bean and the 'SoftwareList' property is an ArrayList. I can display the list no problem and the user can select one or more options and I can grab the selections and save to the database.

The problem arises when I re-display the page and I want to select all the items in the select list that have been retrieved from the database. I set the property 'software' as a String[], and I have validated the array right up to when the page is called. I can't get it to select all items that were previously chosen, infact none of the items are selected.

What am I doing wrong?

Thanks,
Gordon
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

Moving to the Web App Frameworks forum where Struts is discussed.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
 
subject: How to use multiple attribute on html:select struts tag
 
Threads others viewed
Disabling html:select by form bean property
Regarding html:select kind of URGENT
Access all items in Select Box.
dynamic value to be submitted to form beans
retaining selected values.....list box
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture