Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1.3-SNAPSHOT
-
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.