ICEfaces
  1. ICEfaces
  2. ICE-7343

Rows are not rendered at initial rendering of lazy table

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1-Beta
    • Fix Version/s: 2.1-Beta2, 3.0
    • 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.
      1. TestDataModel.java
        4 kB
        Evgheni Sadovoi
      2. simpleDatatableTest.xhtml
        3 kB
        Evgheni Sadovoi
      1. InitialLoading.jpg
        91 kB
      2. AfterPageRefresh.jpg
        193 kB

        Activity

        Hide
        Evgheni Sadovoi added a comment -

        Screenshot demonstrating initial loading of the application

        Show
        Evgheni Sadovoi added a comment - Screenshot demonstrating initial loading of the application
        Hide
        Evgheni Sadovoi added a comment -

        Screenshot demonstrating how the table is rendered with data after page refresh or navigation via pagination from page 1 to page 2 and back.

        Show
        Evgheni Sadovoi added a comment - Screenshot demonstrating how the table is rendered with data after page refresh or navigation via pagination from page 1 to page 2 and back.
        Hide
        Evgheni Sadovoi added a comment -

        Source files to reproduce the problem

        Show
        Evgheni Sadovoi added a comment - Source files to reproduce the problem
        Hide
        Nils Lundquist added a comment -

        Applied suggested rearrangement of code. Simple test case works still.

        Reassigning to Evgheni to confirm that the bug is fixed.

        Show
        Nils Lundquist added a comment - Applied suggested rearrangement of code. Simple test case works still. Reassigning to Evgheni to confirm that the bug is fixed.
        Hide
        Evgheni Sadovoi added a comment -

        This has been tested and confirmed that a fix worked.

        Show
        Evgheni Sadovoi added a comment - This has been tested and confirmed that a fix worked.

          People

          • Assignee:
            Evgheni Sadovoi
            Reporter:
            Evgheni Sadovoi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: