PagedTable icon indicating copy to clipboard operation
PagedTable copied to clipboard

Resized table has wrong pageLength

Open consros opened this issue 11 years ago • 0 comments

If user resizes a PagedTable, in current vaadin implementation (7.2.6) the pageLength property is being changed not over setter (setPageLength) but directly. Therefore the PagedTable doesn't know about this change.

There are two possible ways to fix it.

  1. The risky one. The property is being updated in Table.changeVariables() method. We can override this method and there call the setter. However there is no warranty there will be no new direct property sets in up coming vaadin releases. Therefore it is risky.

  2. The inconsistent one. We can manipulte the getter. We can override the getPageLengh() method in the PagedTable as following:

    @Override public int getPageLength() { return null == container ? super.getPageLength() : container.getPageLength(); }

And use it everywhere the pageLength is needed in the PagedTable class (it is so already) So, the pageLength of the container will be used and it will differ(!) from the pageLength of the Table class.

Please check it.

consros avatar Aug 29 '14 10:08 consros