Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.1-Beta
-
Component/s: ACE-Components
-
Labels:None
-
Environment:Chrome, Firefox, IE, ICEfaces 2.1 BETA, JSF 2.1.1 RI (Mojarra)
-
Assignee Priority:P2
Description
The code in ICEfaces' DataTableRenderer is incorrect and is causing the initial rendering of a lazy table to show now rows, even if the rows are correctly loaded.
////////////////////////////////////////////////////////////////////
DataTableRenderer line 941:
int rowCount = table.getRowCount();
int rowCountToRender = rows == 0 ? rowCount : rows;
boolean hasData = rowCount > 0;
if (table.isLazy()) table.loadLazyData();
////////////////////////////////////////////////////////////////////
The first time this code is called, table.getRowCount() will return 0 because no data has been loaded. The call to table.loadLazyData() should be done before the other lines copied above.
Set an initial rowCount of "1" in my LazyDataModel and the initial rendering of the rows will work because "hasRows" will be true in this case.
However, if this is done and there really is no rows returned by my LazyDataModel, the css classes are not set properly on datatable so I can't style it properly.
Also, if the datatable's getRows is 0 (we want all available rows), it will think the total amount of rows is 1, which is not the case so the workaround is not an acceptable solution.
////////////////////////////////////////////////////////////////////
DataTableRenderer line 941:
int rowCount = table.getRowCount();
int rowCountToRender = rows == 0 ? rowCount : rows;
boolean hasData = rowCount > 0;
if (table.isLazy()) table.loadLazyData();
////////////////////////////////////////////////////////////////////
The first time this code is called, table.getRowCount() will return 0 because no data has been loaded. The call to table.loadLazyData() should be done before the other lines copied above.
Set an initial rowCount of "1" in my LazyDataModel and the initial rendering of the rows will work because "hasRows" will be true in this case.
However, if this is done and there really is no rows returned by my LazyDataModel, the css classes are not set properly on datatable so I can't style it properly.
Also, if the datatable's getRows is 0 (we want all available rows), it will think the total amount of rows is 1, which is not the case so the workaround is not an acceptable solution.
Screenshot demonstrating initial loading of the application