O'Reilly logo

Vaadin 7 UI Design By Example Beginner's Guide by Alejandro Duarte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Selecting items in tables

Tables can listen to clicks on rows. What you need to do is to add an ItemClickListener method to the table:

table.addItemClickListener(this);

Because we are passing a reference to our UI class (this), we must implement ItemClickListener in our BoxwordsUI class:

public class BoxwordsUI extends UI implements ItemClickListener {
  public void itemClick(ItemClickEvent event) { }
}

The itemClick method will be called every time the user clicks on a table row. Let's add that behavior right away.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required