Giter Site home page Giter Site logo

Comments (17)

melloware avatar melloware commented on May 26, 2024 1

@AndrewG10i i am pretty sure based on the migration guide for 11.0.0 you should not have been returning count 0 even then based on this migration note: https://primefaces.github.io/primefaces/13_0_0/#/../migrationguide/11_0_0?id=datatable-dataview-datagrid-datalist

from primefaces.

melloware avatar melloware commented on May 26, 2024 1

@tandraschko @AndrewG10i @jungm I got to the bottom of it and its this fix: #11402

It also came with an integration test so we have conflicting issues both with integration tests proving something is wrong.

from primefaces.

melloware avatar melloware commented on May 26, 2024

See: #11377

It's only for virtual scroll and live scroll. So it should not affect paginator at all. As there is no paging in live scroll or virtual scroll mode?

from primefaces.

github-actions avatar github-actions commented on May 26, 2024

Please provide an executable example using the PrimeFaces Test project. This issue will be closed if no activities in 20 days.

from primefaces.

AndrewG10i avatar AndrewG10i commented on May 26, 2024

This is the code (DataTable declaration) I have:

<p:dataTable id="usersTable" value="#{dirCntroller.usersLazyDS}" lazy="true" var="rowData" rowIndexVar="rowIndex"
             paginator="true" rows="25" rowsPerPageTemplate="25,50,100" paginatorPosition="top" paginatorAlwaysVisible="true"
             paginatorTemplate="{CurrentPageReport} {JumpToPageDropdown} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
             reflow="true" emptyMessage="#{labels['general.dataTable.noRecordsFound']}" filterDelay="800" styleClass="usersTable" widgetVar="usersTableWV">

I will try to prepare reproducer. Meanwhile decided to report the issue so in case someone else have it they can confirm as well.

from primefaces.

melloware avatar melloware commented on May 26, 2024

We have tons of integrations tests that test pagination and datatable that all passed so if this is a bug it means there is a gap in the integration tests.

from primefaces.

AndrewG10i avatar AndrewG10i commented on May 26, 2024

Okay, so far cannot reproduce this issue, reproducer works fine. Will investigate further what exactly triggers issue in my app and in case issue found in the PF lib - will reopen this ticket again. But for now closing it. Thanks!

from primefaces.

melloware avatar melloware commented on May 26, 2024

Thanks yes please let me know what you find out!

from primefaces.

AndrewG10i avatar AndrewG10i commented on May 26, 2024

Okay, after spending several hours on this, I finally found the root cause. ;))
Considered particular project uses PF since version 11.x and it was working fine until v13.0.5 (inclusive). But since v13.0.6 - behavior of paginator in DataTable with LazyDataModel has changed.

So basically the root cause is related to the Issue 8062. As discussed in that issue - we also require to use one single API call for retrieving data from the DB, and result returns two values pair: data subset and count of the whole data set.

As such, LazyDataModel.count() method returns 0 only, and the respective handling is implemented in the LazyDataModel.load() method.
And this causes the issue with pagination.

So once I change LazyDataModel.count() from return 0; to return actual count - it fixes behavior of paginator in v13.0.6 as well.

Could you please reopen this issue and provide your feedback? Also please let me know if you would like me to post a reproducer as well. Thank you!

from primefaces.

melloware avatar melloware commented on May 26, 2024

@Rapster @tandraschko thoughts here?

from primefaces.

tandraschko avatar tandraschko commented on May 26, 2024

we must support cases like seen here: #8062 (comment)
a reproducer would be great

@melloware can you check what did we change DataTable related in 13.0.6? also if we have similar integration tests?

from primefaces.

melloware avatar melloware commented on May 26, 2024

@tandraschko we have tons of integration tests and the only change was to fix LiveScroll and Virtual Scroll. Regular pagination was not touched.

See: #11377

from primefaces.

github-actions avatar github-actions commented on May 26, 2024

Please provide an executable example using the PrimeFaces Test project. This issue will be closed if no activities in 20 days.

from primefaces.

AndrewG10i avatar AndrewG10i commented on May 26, 2024

@AndrewG10i i am pretty sure based on the migration guide for 11.0.0 you should not have been returning count 0 even then based on this migration note: https://primefaces.github.io/primefaces/13_0_0/#/../migrationguide/11_0_0?id=datatable-dataview-datagrid-datalist

Thanks for pointing to that note. But seems the project still in compliance with it. :)
Under the item "see DataTable for details how to avoid a separate count-statement against your datasource" it basically shows the implementation as per 8062.

Let me post reproducer shortly...

from primefaces.

tandraschko avatar tandraschko commented on May 26, 2024

@melloware we dont have a testcase for this - we should just copy DataTable037 and implement rowCount return0

from primefaces.

tandraschko avatar tandraschko commented on May 26, 2024

see tandraschko@cf3f997

it fails currently

from primefaces.

melloware avatar melloware commented on May 26, 2024

OK good thanks for adding a test case. Let me look and see if I can debug.

from primefaces.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.