Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 1.54 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Struts 1 - Row submit
  2. <html:form action="/myAction" styleClass="centeredForm"  style="display:inline" >
  3.   <td class="formLabel">City</td>
  4.   <td class="formControl">
  5.     <bean:define id="cities" name="myForm"
  6.                  property="cities" type="java.util.Collection"/>
  7.     <html:select styleClass="dashSelect" property="city">
  8.       <html:option value="">All Cities</html:option>
  9.       <html:options collection="cities"
  10.                     property="id" labelProperty="value"/>
  11.     </html:select>
  12.   </td>
  13.  
  14.   ... Other elements ...
  15.  
  16.   <logic:iterate id="myObject" name="myForm" property="myObjects" indexId="index" type="com.test.MyObject">
  17.       <% String rowClass = index.intValue() % 2 == 0 ? "even-row" : "odd-row"; %>
  18.     <tr class="<%=rowClass%>">
  19.       <td class="result-cell"><bean:write name="myObject" property="id" />&nbsp;</td>
  20.       <td class="result-cell"><bean:write name="myObject" property="name" />&nbsp;</td>
  21.       <td class="result-cell">
  22.         <html:select styleClass="dashSelect" name="myObject" property="status">
  23.           <html:option value="F">Disabled</html:option>
  24.           <html:option value="T">Enabled</html:option>
  25.         </html:select>
  26.       </td>
  27.  
  28.       <td>
  29.         <html:submit/>
  30.       </td>
  31.        
  32. <logic:iterate name="myForm" property="myObjects" id="myObjects" indexId="true">
  33.   <tr>
  34.    <td class="result-cell"><bean:write name="myObjects" property="id" />&nbsp;</td>
  35.       <td class="result-cell"><bean:write name="myObjects" property="name"/>&nbsp;</td>
  36.       <td>
  37.         <html:submit/>
  38.       </td>    
  39.   </tr>
  40. </logic:iterate>