Hi!
I'm having trouble with the following scenario.
I generate a table with a column in which i place a checkbox per row. The number of checkboxes created depends on the size of a collection. Something similar to the gmail inbox folder. I want to be able to select one or more of these checkboxes to perform some action over the objects they represent (remove them in my case)
If i use checkboxlist tag in my
jsp page, (lets say i have 10 objects in the collection) it displays the 10 checkboxes toguether, and not one in each row (dont know how to format that)
So i decided to try the checkbox tag, but i cant get the values in my action class.
I have something like this:
<s:iterator value="taxSystem.operations" status="rowstatus">
<tr>
<td>
<s
roperty value="#rowstatus.index" />
</td>
<td align="center">
<s
roperty value="operationName" />
</td>
<td align="center">
<s
roperty value="code"/>
</td>
<td align="center">
<s:checkbox name="selectedOperations[#rowstatus.index]" theme="simple" />
</td>
</tr>
</s:iterator>
In my class action i have a variable
String[]selectedOperations with setter and getter... but when i see what gets inside i have only the position [0] with a String like this: "true, true, true" depending on how many checkboxes were checked. The thing is that i cant distinguis which true corresponds with which checkbox since empty checkboxes dont include "false" to that String.
Can anybody give a hand and tell me what do i do wrong?
In case it was not obvious yet, i am new in
Struts 2, and dont know Struts, so please be patient
Thanks in advance