HtmlTableRendererBase.encodeInnerHtml() fails when data model returns -1 for getRowCount() ------------------------------------------------------------------------------------------
Key: MYFACES-1092 URL: http://issues.apache.org/jira/browse/MYFACES-1092 Project: MyFaces Type: Bug Components: Implementation Versions: 1.1.1 Reporter: Craig McClanahan Per the JSF spec, ResultSetDataModel.getRowCount() returns -1, to avoid the potential of scrolling through a very large result set to find the number of rows. This means that components that might be bound to such a result set (such as the "value" property on an HtmlDataTable component) must take into account that they might get a -1 back when asking for the row count. The logic in the encodeInnerHtml() method of HtmlTableRendererBase fails to account for this possibility in the calculation of the "last" index to be rendered, and causes zero rows to be printed in a scenario where the table component is bound directly to a ResultSetDataModel, no matter how many rows the result set actually returns. For example: <h:dataTable ... value="#{mybean.rsdm}" var="current" .../> where the "rsdm" property is a ResultSetDataModel that wraps a ResultSet that returns a non-zero number of rows. This scenario works correctly with the JSF RI implementation. For example apps that illustrate this, check the SQL Browser example in Shale, or the "UIData" example from the JSF RI's standard demo application. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira