posted 10 years ago
Hello,
I am trying to iterate over array of objects and disply checkbox as per the boolean value that is present in the model object. For some reason, it is not working. Below is what, I am doing:
<s:iterator value="objectsList" status="status" >
<TR>
<s:hidden name="objectsList[%{#status.index}].text" readonly="true"/>
<TD>
<s:property value="text" />
</TD>
<TD>
<s:checkbox name="objectsList[%{#status.index}].not" />
</TD>
<TD>
<s:textfield name="objectsList[%{#status.index}].value" />
</TD>
</TR>
</s:iterator>
In the above:
<s:property> and <s:textfield> are working properly as expected (both of them are Strings).
But for the Checkbox, it is not working. Even, if I select the checkbox and submit the form, the checkbox value (true) is not getting set in the model object and so, when the page got reloaded, it is still being shown as "unchecked".
In the above: "not" is a boolean variable and it had both setter and getter methods.