• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use multiple attribute on html:select struts tag

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the Web App Frameworks forum where Struts is discussed.
 
reply
    Bookmark Topic Watch Topic
  • New Topic