4 Replies Latest reply on Jan 23, 2008 4:06 PM by Neil McFarlane

    Displaying dataTable row numbers with uiComponent, what am I

    Neil McFarlane Novice

      Hello.

      The Seam reference guide has the following snippet (pg. 113 / 322)


      Alternatively, you can access the JSF component tree through the implicit uiComponent handle. The following
      example accesses getRowIndex()of the UIData component which backs the data table during iteration, it prints
      the current row number:
      <h:dataTable id="lineItemTable" var="lineItem" value="#{orderHome.lineItems}">
      <h:column>
      Row: #{uiComponent['lineItemTable'].rowIndex}
      </h:column>
      ...
      </h:dataTable>

      JSF UI components are available with their client identifier in this map.


      I've tried it in my code (shown below), but I only get a blank.
      <h:dataTable id="emailTable" value="#{person.emailAddresses}" var="email" rendered="#{not empty person.emailAddresses}">
       <h:column>
       Row:<h:outputText value="#{uiComponent['emailTable'].rowIndex}"/>
       </h:column>
      ...
      


      Is there something else I need to do to have it display?