Skip to content

Pagination of PagedFilterTable with fixed height does not work #123

Description

@fsomme2s

If a PagedFilterTable has a fixed height, so that it does not grow vertically with the count of table rows (instead you want to scroll in the table body), the pagination is buggy.

Once you hit the "next page" button, the totalPagesLabel shows a wrong number. Moreover, you dont land on the proper "next" page.

Example: itemsPerPage is 25, but there is only space for 15 rows. User need to scroll to find the additional 10 rows. 100 Items total = 4 totalPages.

When you hit "next button" the totalPages go up to 7 ( = 100 / 15) and you land on a page, that starts with item number 16.

The problem is, that pagedfiltertable "abuses" the CustomTable.pagelength field. This variable stores how many items are effectively shown (in the example: 15).
But PagedFilterTable uses it, as if it was always (pageLength == itemsPerPage), which is only true, if the height of the table is undefined.

You can workaround with overwriting CustomTable.changeVariables and removing the "pagelength" variable - the client sends this variable in order to tell the server: "Hey, only space for 15 Rows here" - this workaround of removing client's "pagelength" variable prevents the pagelength variable to be overwritten by the client... BUT causes strange UI behaviour in return, for example if you select a row in the table that is below the 15-row border: you scroll down to such a row, click on it => and there is a strange jump-bug...

Core problem is: pagelength should not be used to store the itemsPerPage, as it seems to be heavily used by the vaadin framework / CustomTable for UI-Rendering purpose, which is in conflict to its use in PagedFilterTable for pagination purpose.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions