table.setSelectable(true);
table.setImmediate(true);
table.setNullSelectionAllowed(true);
table.addContainerProperty("Name", String.class, null);
table.addListener(getTableValueChangeListener());
Person person = new Person("Teppo", "Testaaja",
"teppo.testaaja@example.com", "", "Ruukinkatu 2–4", 20540,
"Turku");
Person person2 = new Person("Taina", "Testaaja",
"taina.testaaja@example.com", "", "Ruukinkatu 2–4", 20540,
"Turku");
Item item = table.addItem(person);
item.getItemProperty("Name").setValue(
person.getFirstName() + " " + person.getLastName());
item = table.addItem(person2);
item.getItemProperty("Name").setValue(
person2.getFirstName() + " " + person2.getLastName());
return table;
}