updating elements in a collection

Hey. I'm trying to update the objects in a collection that is displayed on a jsp. Everything loads fine, the collection displayed using logic:iterate, but the on of the fields in each record is a checkbox and on form submit, my changes to the checkbox is not on the form! Anyone know how I can force the form to update the checked item in the collection? Any help will be greatly appreciated :)

<logic:iterate id="language" name="languages" type="za.co.intelleca.vodacom.application.entity.display.LanguageDisplay">

<tr align="center" valign="top" class="th" bgcolor="<%=colour%>">

<td align="left"><bean:write name="language" property="name" /></td>

<td align="left"><bean:write name="language" property="description" /></td>

<td align="center"><html:checkbox name="language" property="checked" value="<bean:write name='language' property='checked'/>" /></td>

</tr>

</logic:iterate>

where the form has a LanguageDisplay[] lanaguages and I get/set the []

[1529 byte] By [applea] at [2007-11-27 8:17:50]
# 1

Ok there are a couple of ways to do this.

1

- give each checkbox a unique identifying value/id

- a call to request.getParameterValues("language") would return you a String[] containing all the values of the checkboxes that were selected.

2

The other approach is to use struts indexed properties.

http://struts.apache.org/1.x/struts-taglib/indexedprops.html

It would be something like:

<html:checkbox indexed="true" name="languages" property="checked"/>

evnafetsa at 2007-7-12 20:03:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...