how to show/hide rows when using iterate tag...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prathna
    New Member
    • Jun 2007
    • 7

    how to show/hide rows when using iterate tag...

    Hi ..
    I have a logic:iterate tag which will display 5 rows each row with a drop downlist and 2 textfields.now by default all the rows will be shown.how do i hide all the rows except the first one.i know how to show/hide a row when its not dynamic.but i dont know how to do it when its logic iterate tag.
    Code:
    <logic:iterate indexId="index" id="phoneItem"  name="nameForm" property="results">
    <%
    String dropdownType = "results["+index+"].dropdownType";
    String firstName = "results["+index+"].firstName";
    String lastName = "results["+index+"].lastName";
    String layerName= "name["+index+"]";
    %>
    <tr id="<%=layerName%>" style="display:''">
     <td></td>
    <td>
      <html:select name="nameform"	property="<%= dropdownType %>">
          <html:option value=""><bean:message key="default.select"       bundle="defaults"/></html:option>
    <html:optionsCollection property="names.prefix" />
    </html:select>
    </td> 
    <td>
    <input type="text" property="<%=firstName %>" />
    </td>
    <td>
    <input type="text" property="<%=lasName %>" />
    </td>
    </tr>
    </logic:iterate>
    Please it would be great if someone could help me out with it.

    Thanks
    Prathna
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Within the style attribute, check that the index is not the first index. If it isn't, use "none".

    Comment

    Working...