O'Reilly logo

Vaadin 7 Cookbook by Ondrej Kvasnovsky, Jaroslav Holan

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

Inserting a button to remove a table row

When we are working with tables, we can use a useful feature for generating columns. In Vaadin, a table is created according to the Container that is used as a data source. If we use the BeanItemContainer class, then for each field in the container bean one column is generated. So, if we want to add an other column, we can generate it using the Table.addGeneratedColumn() method. This generated column exists only in the Table, not as a property in the underlying Container. We will use it for generating buttons that remove a current row, as shown in the following screenshot:

Inserting a button to remove a table row

How to do it...

Carry out the following ...

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