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. simpleDatatableTest.xhtml
        3 kB
        Evgheni Sadovoi
      2. TestDataModel.java
        4 kB
        Evgheni Sadovoi
      1. AfterPageRefresh.jpg
        193 kB
      2. InitialLoading.jpg
        91 kB

        Activity

        Evgheni Sadovoi created issue -
        Evgheni Sadovoi made changes -
        Field Original Value New Value
        Salesforce Case [5007000000JLRpt]
        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
        Evgheni Sadovoi made changes -
        Attachment InitialLoading.jpg [ 13666 ]
        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.
        Evgheni Sadovoi made changes -
        Attachment AfterPageRefresh.jpg [ 13667 ]
        Hide
        Evgheni Sadovoi added a comment -

        Source files to reproduce the problem

        Show
        Evgheni Sadovoi added a comment - Source files to reproduce the problem
        Evgheni Sadovoi made changes -
        Attachment TestDataModel.java [ 13668 ]
        Attachment simpleDatatableTest.xhtml [ 13669 ]
        Ken Fyten made changes -
        Fix Version/s 2.1 [ 10241 ]
        Assignee Priority P2
        Assignee Nils Lundquist [ nils.lundquist ]
        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.
        Nils Lundquist made changes -
        Assignee Nils Lundquist [ nils.lundquist ] Evgheni Sadovoi [ evgheni.sadovoi ]
        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.
        Evgheni Sadovoi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.1-Beta2 [ 10294 ]
        Fix Version/s 2.1 [ 10241 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 3.0 [ 10241 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: