
Untitled
By: a guest on
May 9th, 2012 | syntax:
None | size: 1.54 KB | hits: 24 | expires: Never
Struts 1 - Row submit
<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>
<logic:iterate name="myForm" property="myObjects" id="myObjects" indexId="true">
<tr>
<td class="result-cell"><bean:write name="myObjects" property="id" /> </td>
<td class="result-cell"><bean:write name="myObjects" property="name"/> </td>
<td>
<html:submit/>
</td>
</tr>
</logic:iterate>