I'm trying to use a select box, with multiple selections.
I originally had the input types on my form all set to String. With this it would only give me the first item selected from the box. I assumed this was because the tag returns a String. When I change the form to accept a String it errors out. Can anyone please point me to an example using this, or an explaination. Thank you.
String is the correct type to use with an <html:select> tag that allows multiple selection. Make sure that both your getter and setter use this type. Also make sure that it is not null. You should declare it something like this:
private String mySelect = new String;
or else put the following statement in your reset() method:
myselect = new String;
If you've tried these suggestions and it still doesn't work, please tell us the error message you're getting and post relevant portions of the jsp and struts-config.xml file.
When I add a project, via my add form it only adds the first item in the list, not any selected items following. When I use the edit form it resets the field to null, no matter what is selected. Code snippets follow.
Add Form: -declaration
-getters and setters
Value Object (ProjectImpl):
[ September 12, 2006: Message edited by: Chris Novindus ]