Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pageable and sort order problem #11

Open
dmarko484 opened this issue May 15, 2018 · 2 comments
Open

Pageable and sort order problem #11

dmarko484 opened this issue May 15, 2018 · 2 comments

Comments

@dmarko484
Copy link

Hello,
I'm trying to use your provider with Vaadin 10(beta10) and I struggle with sort order not working properly. I have 'FilterablePageableDataProvider' attached to 'com.vaadin.flow.component.grid.Grid' . I have a few columns defined as sortable in the Grid. Now when I click on any sortable column, I cannot see a proper sorted column name in 'fetchFromBackEnd' method in Pageable object (using code below).

 protected Page<Porada> fetchFromBackEnd(Query<Porada, String> query, Pageable pageable) {          
    System.out.println(pageable.getSort().iterator().next().getProperty());
    ...
}

What I always get is column name defined in getDefaultSortOrders() ... in provider. Any ideas what is going one here?

BTW: Thanks for such a great addon!

@TatuLund
Copy link

See also: github.com/vaadin/framework/issues/12411

@SebastianDietrich
Copy link

We had the same issue until we found out the obvious: Pagination needs unique entries - i.e. if you sort a grid based on a row that is not unique, then pagination will possibly return the same elements twice or others not even once. --> make sure that you sort based on a row AND some unique row (e.g. ID)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants