You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Emmanuel <em...@hotmail.com> on 2004/01/31 20:05:31 UTC

indexed checkbox and set method

I want to use a form that looks like this :

<form>
<input type="checkbox" name="indexProp[1]" value="value1"/>
<input type="checkbox" name="indexProp[1]" value="value2"/>

<input type="checkbox" name="indexProp[2]" value="value1"/>
<input type="checkbox" name="indexProp[2]" value="value2"/>
..
</form>

I made my form bean with this get :
public class AddRACIForm extends ActionForm {
private List prop = new ArrayList();
..
public void setIndexProp(int key, Object myobject) {
this.prop.set(key, myobject);
}
}

But if I check both boxes "value1" and "value2" for, say, indexProp[1], the Object myobject I get in setIndexProp() is the String "value1" only (and never "value2").

How can I do to get an array of string[] in my action form, instead of a string ?


Thanks in advance,
Emmanuel



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004