ICEfaces
  1. ICEfaces
  2. ICE-8297

LazyDataModel with pagination breaks export feature

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.1, EE-3.0.0.GA, 3.1.0.BETA2
    • Fix Version/s: 3.1, EE-3.0.0.GA_P01
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Tomcat 7, Firefox, IE, Chrome
    • Assignee Priority:
      P1

      Description

      When LazyDataModel is used with datatable having pagination, it break the export feature.

      To reproduce:
      1. deploy attached .war file
      2. Go to the ace:dataTable > Lazy Loading example.
      3. Click on the button to export dataTable as cvs file.

      Exported file will contain duplicate data after first page rows of the ace:dataTable.
      31st record will be a duplicate of 1st row on page 1, 32nd record will be a duplicate of 2nd row on page 1 etc.

      .cvs file outcome attached.
      1. cars.csv
        3 kB
        Evgheni Sadovoi
      2. showcase.part1.rar
        5.00 MB
        Evgheni Sadovoi
      3. showcase.part2.rar
        5.00 MB
        Evgheni Sadovoi
      4. showcase.part3.rar
        5.00 MB
        Evgheni Sadovoi
      5. showcase.part4.rar
        1.18 MB
        Evgheni Sadovoi

        Activity

        Evgheni Sadovoi created issue -
        Evgheni Sadovoi made changes -
        Field Original Value New Value
        Salesforce Case [5007000000MIb0K]
        Description When LazyDataModel is used with datatable having pagination, it break the export feature. For example, if my records per page is 50, total records are 60, then when you export this data using ace:dataExporter with pageOnly=false, the resulting data contains 60 rows, first 50 rows correspond to the ones shown on the page and next 10 rows are duplicated from the first page again instead of the remaining 10 rows.

        To reproduce:
        1. deploy attached .war file
        2. Go to the ace:dataTable > Lazy Loading example.
        3. Click on the button to export dataTable as cvs file.

        Exported file will contain duplicate data.
        When LazyDataModel is used with datatable having pagination, it break the export feature.

        To reproduce:
        1. deploy attached .war file
        2. Go to the ace:dataTable > Lazy Loading example.
        3. Click on the button to export dataTable as cvs file.

        Exported file will contain duplicate data after first 30 rows.
        Evgheni Sadovoi made changes -
        Attachment showcase.part1.rar [ 14629 ]
        Evgheni Sadovoi made changes -
        Attachment showcase.part2.rar [ 14630 ]
        Evgheni Sadovoi made changes -
        Attachment showcase.part3.rar [ 14631 ]
        Attachment showcase.part4.rar [ 14632 ]
        Evgheni Sadovoi made changes -
        Attachment cars.csv [ 14633 ]
        Evgheni Sadovoi made changes -
        Description When LazyDataModel is used with datatable having pagination, it break the export feature.

        To reproduce:
        1. deploy attached .war file
        2. Go to the ace:dataTable > Lazy Loading example.
        3. Click on the button to export dataTable as cvs file.

        Exported file will contain duplicate data after first 30 rows.
        When LazyDataModel is used with datatable having pagination, it break the export feature.

        To reproduce:
        1. deploy attached .war file
        2. Go to the ace:dataTable > Lazy Loading example.
        3. Click on the button to export dataTable as cvs file.

        Exported file will contain duplicate data after first page rows of the ace:dataTable.
        31st record will be a duplicate of 1st row on page 1, 32nd record will be a duplicate of 2nd row on page 1 etc.

        .cvs file outcome attached.
        Hide
        Ken Fyten added a comment -

        It seems that when using dataExporter with lazy data model it should only export those rows that have been loaded at the time of export.

        Show
        Ken Fyten added a comment - It seems that when using dataExporter with lazy data model it should only export those rows that have been loaded at the time of export.
        Ken Fyten made changes -
        Fix Version/s 3.1 [ 10312 ]
        Fix Version/s EE-3.0.0.GA_P01 [ 10327 ]
        Assignee Priority P2
        Assignee Arturo Zambrano [ artzambrano ]
        Ken Fyten made changes -
        Assignee Priority P2 P1
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #29851 Fri Jul 06 16:18:09 MDT 2012 art.zambrano ICE-8297 fixed issue so that only the current page is exported when using lazy loading in the table
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/DataExporter.java
        Hide
        Arturo Zambrano added a comment - - edited

        Committed fix at revision 29851. Fixed issue so that only the current page is exported when using lazy loading in the table.

        A few observations:

        • Because the lazy data is loaded in the table component at the moment of rendering the table body, the data will be loaded again at the moment of clicking the export button. This is something that the app developer must take into account, since there could be some cases where it is not desired to load the data again. In this specific test case, the data is generated randomly, so the data exported and the data displayed on the page may be different, depending on which component was rendered first. This particular situation can be solved by simply preventing the data table from rendering when the export button is clicked. This can be accomplished by the use of the ace:ajax tag. It would also be convenient to have the export button in a separate form.
        • This particular test case sets the row count to 60 when loading the data lazily, but the page size of the table is 31, so you might see a few rows less when exporting the second page, since the exporter won't try to export anything beyond the maximum number of rows, as one would expect. If the page size of the table is set to 30 (i.e. matching the row count specified when loading the data lazily), then you'll see the same number of rows when exporting the second page.
        Show
        Arturo Zambrano added a comment - - edited Committed fix at revision 29851. Fixed issue so that only the current page is exported when using lazy loading in the table. A few observations: Because the lazy data is loaded in the table component at the moment of rendering the table body, the data will be loaded again at the moment of clicking the export button. This is something that the app developer must take into account, since there could be some cases where it is not desired to load the data again. In this specific test case, the data is generated randomly, so the data exported and the data displayed on the page may be different, depending on which component was rendered first. This particular situation can be solved by simply preventing the data table from rendering when the export button is clicked. This can be accomplished by the use of the ace:ajax tag. It would also be convenient to have the export button in a separate form. This particular test case sets the row count to 60 when loading the data lazily, but the page size of the table is 31, so you might see a few rows less when exporting the second page, since the exporter won't try to export anything beyond the maximum number of rows, as one would expect. If the page size of the table is set to 30 (i.e. matching the row count specified when loading the data lazily), then you'll see the same number of rows when exporting the second page.
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #30039 Tue Jul 17 14:53:43 MDT 2012 art.zambrano ICE-8297 fixed issue so that only the current page is exported when using lazy loading in the table
        Files Changed
        Commit graph MODIFY /icefaces3/branches/icefaces-3.0.x-maintenance/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/DataExporter.java
        Hide
        Arturo Zambrano added a comment -

        Committed fix to maintenance branch at revision 30039.

        Show
        Arturo Zambrano added a comment - Committed fix to maintenance branch at revision 30039.
        Arturo Zambrano made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #31068 Tue Sep 25 14:45:07 MDT 2012 art.zambrano ICE-8297 fixed issues with exporting selected rows when using LazyDataModel
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/XMLExporter.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/PDFExporter.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/CSVExporter.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/dataexporter/ExcelExporter.java
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: