This is the Vaadin 8 PagedTable in compatibility mode, for migrating from Vaadin 7 to Vaadin 8 projects. When you have migrated, I suggest you switch from Table to Grid. GridExtensionPack Add-on provides a Paged Container and that does similar things to Grid as this addon does to Table.
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>pagedtable</artifactId>
<version>0.7.0</version>
</dependency>
public class PagedtableExample extends UI {
@Override
protected void init(final VaadinRequest request) {
PagedTable table = new PagedTable("PagedTable Example");
ControlsLayout controls = table.createControls();
BeanItemContainer container = new BeanItemContainer(User.class);
table.setContainerDataSource(container);
layout.addComponent(table);
layout.addComponent(controls);
setContent(layout);
}
}
When you create a new instance of PagedTable then you should create controls layout by using createControls() method. createControls() method returns instance of ControlLayout class. You can do the following then.
ControlsLayout controls = table.createControls();
controls.getItemsPerPageLabel().setValue("Items");
controls.getBtnFirst().setCaption("First");
controls.getBtnLast().setCaption("Last");
controls.getBtnNext().setCaption("Next");
controls.getBtnPrevious().setCaption("Previous");
controls.getPageLabel().setValue("Current:");