Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-485

Extended DataTable renderRowStart called before setRowIndex

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.3-SNAPSHOT
    • 1.1.4-SNAPSHOT
    • Extended Datatable
    • None
    • linux, java 5, tomcat 5

    Description

      When the extended HtmlDataTable was merged with the newspaper table code, a bug was introduced that effects the rendering of the row-level attributes (rowIndexVar, rowStyle, rowStyleClass). The problem is that the renderRowStart is called before the setRowIndex is called, so therefore all of the data available to the expressions in these attributes is uninitialized on the first row, and then always one row behind rendering subsequent rows.

      The following simple example demonstrates the issue:

      <t:dataTable var="item" value="#

      {bean.items}

      " rowIndexVar="index" rowId="row#

      {index}">
      <h:column>
      row index: <h:outputText value="#{index}

      " />; item: <h:outputText value="#

      {item}

      " />
      </h:column>
      </t:dataTable>

      You will see when you render this using tomahawk 1.1.3 that the output is as follows:

      row index: 0; item: child1 (rowId=row)
      row index: 1; item: child2 (rowId=row0)

      The expected values would be that the row id would have the same numerical part as the row index, but as you can see it is off by one.

      Attachments

        1. tomahawk-485.txt
          2 kB
          Dan Allen

        Activity

          People

            Unassigned Unassigned
            dan.j.allen Dan Allen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: