Hi!
I have a few times seen the question: “how do I use pages in table instead of scrolling”. I have also answered that question a couple of time and made a proof of concept (PoC). Recently a member of this forum had found my PoC somehow and asked how I’ve created it. Unfortunately, I couldn’t find the sources to the quick and dirty PoC, so I decided to make a new component for the directory. Therefore, let me introduce PagedTable!
This is still just a experimental release and I will continue the development if people show interest in the component. The sources is also included so it can be a start point for you to create your own implementation to the issue. But if you get around to test it, please add your comments and feedback to this thread and I’ll prioritize them and see what can be done. Expect issues.
When I started the project I wanted it to be a complete server side component to avoid widgetset compilation. For this reason I had to make it a CustomComponent to add the button instead of extending Table directly. In other words, the component is a Table wrapped into a CustomComponent with delegate methods to the table. It also implements the Field interface so that it can be used in a form.
The addon can be found at
Vaadin Directory
and an online demo can be found at
http://jens.virtuallypreinstalled.com/PagedTable
. Issue tracking is found at
https://github.com/Peppe-/PagedTable/issues
.
Known issues:
- setHeight causes wrong amout of rows to be rendered and renders one (half) row too much. This will cause a very little scrollable scrollbar to the table. Use setPageLength instead if possible.
- Having different height rows will throw off the rendering. Same symptoms as above.
- IE8: Sometimes when you load the table for the first time, the page length is wrong, even if the loaded data amount is correct. The issue fixes itself if you change the page or restart the application.
- The application automatically does some scrolling when the PagedTable is bigger that the panel it is in and you select a row while the first row of the table is not visible. Vaadin issue:
http://dev.vaadin.com/ticket/6197
Further Improvements to be made:
- Figure out how multiselect could be used when selection spans over multiple pages