Hi,

I am trying to use checkboxes for the selection of elements in an iterate
tag. I believe that I have a few problems with this.  Given the following
structure:

============================================

<struts:form action="confirmAddressMapDelete.do" name="SelectedEntriesForm"
type="work.addressMap.SelectedEntriesForm">

<struts:hidden property="action"/>

<table border="1" width="100%">
    <struts:iterate id="addressMapEntry" name="AddressMapResultSet">
      <tr>
          <td align="left">
            <struts:checkbox name="addressMapEntry" property="selected"/>
          </td>
          <td align="center">
              <struts:htmlProperty name="addressMapEntry" property="id"/>
          </td>
      </tr>
</struts:iterate>
</table>

<struts:submit>
   <struts:message key="button.delete"/>
</struts:submit>
<struts:submit>
   <struts:message key="button.reassociate"/>
</struts:submit>

</struts:form>

===========================================


1) How can I make sure that each checkbox tag is unique.  If they are driven
from the same collection (AddressMapResultSet here), it also implies that
the same property will be used??  (or am I wrong about this?)

2) Even if I find a way to make the checkbox name unique, what would be the
best way to place this information in a form...given that the property name
must have a getter and setter method.

3) Is there a standard approach on how to deal with the HTML checkbox setter
problem.  I have seen several messages about different methods on how to
handle these but I am wondering if there is one that will make its way in
the struts development.

Help would be greatly appreciated.

Martin

Reply via email to