I'm having an issue with a Struts 1 form, which contains a logic:iterate in charge of creating rows, each with an input button. The problem comes up when I hit any of those submit buttons, the dynamic data is not properly being posted and the form doesn't have those values, here's an example:
<html:form action="/myAction" styleClass="centeredForm" style="display:inline" >
<td class="formLabel">City</td>
<td class="formControl">
<bean:define id="cities" name="myForm"
property="cities" type="java.util.Collection"/>
<html:select styleClass="dashSelect" property="city">
<html:option value="">All Cities</html:option>
<html:options collection="cities"
property="id" labelProperty="value"/>
</html:select>
</td>
... Other elements ...
<logic:iterate id="myObject" name="myForm" property="myObjects" indexId="index" type="com.test.MyObject">
<% String rowClass = index.intValue() % 2 == 0 ? "even-row" : "odd-row"; %>
<tr class="<%=rowClass%>">
<td class="result-cell"><bean:write name="myObject" property="id" /> </td>
<td class="result-cell"><bean:write name="myObject" property="name" /> </td>
<td class="result-cell">
<html:select styleClass="dashSelect" name="myObject" property="status">
<html:option value="F">Disabled</html:option>
<html:option value="T">Enabled</html:option>
</html:select>
</td>
<td>
<html:submit/>
</td>
The "city" portion and the rest outside of the logic:iterate, come up just fine on "myForm", but "myObject" isn't. I even tried submitting this with a JavaScript function but wasn't able to get it properly working. Currently, what I have (That html:submit that I left as a reference) causes the POST to contain a bunch of "status" parameters and the proper values that I mentioned before.
Can anyone shed some light onto this?
Let me know if you need further information.
Thanks a lot in advance!
Instead of using one single form, I've just used a form inside the logic:iterate, added indexes to the corresponding properties and used a Javascript function to obtain the rest.
Thanks!