mainLayout.setMargin(true);
setTheme("pagedtabletheme");
}
public PagedTable createTable() {
PagedTable pagedTable = new PagedTable(
"Hello user of Vaadin! This is an example application for the PagedTable -component.");
pagedTable.setContainerDataSource(createContainer());
pagedTable.setRowHeaderMode(Table.ROW_HEADER_MODE_ICON_ONLY);
pagedTable.setItemIconPropertyId(FLAG);
pagedTable.setWidth("700px");
pagedTable.setPageLength(25);
pagedTable.setSelectable(true);
pagedTable.addGeneratedColumn("Generated", new ColumnGenerator() {
private static final long serialVersionUID = -5042109683675242407L;
public Component generateCell(Table source, Object itemId,
Object columnId) {
System.out.println("generateCell called " + ++i + " times.");
Item item = source.getItem(itemId);
return new Label(item.getItemProperty(NAME).getValue() + " - "
+ item.getItemProperty(SHORT).getValue());
}
});
pagedTable.setColumnHeaders(new String[] { "Country", "Country Code",
"Path to Flag", "A generated column." });
return pagedTable;
}