Footers

Footers are the best place to show totals or any data related to columns. They are placed at the bottom of each table column. To show footers you have to make them visible by using the following:

table.setFooterVisible(true);

Then, you can set the footer using the setColumnFooter method:

table.setColumnFooter("Column 1", "Footer 1");

Clicking on footers

Similar to headers, you can add click listeners to the footers. The following code will show a notification every time the user clicks on the footer:

table.addFooterClickListener(new FooterClickListener() {

  public void footerClick(FooterClickEvent event) {
    Notification.show("Footer clicked: " + event.getPropertyId());
  }

});

Get Vaadin 7 UI Design By Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.