Editable tables
Vaadin has a really cool feature that allows us to implement editable tables lightning fast. Let's say we have a table like this:
Table table = new Table(); table.setPageLength(0); table.addContainerProperty("String", String.class, ""); table.addContainerProperty("Boolean", Boolean.class, false); table.addContainerProperty("Date", Date.class, null); table.addItem(); table.addItem(); table.addItem();
That is a simple table with three columns, each one storing properties of String
, Boolean
, and Date
types. We have added three rows to it. This table will be rendered as follows:
Nothing's new so far. I said that it is lightning fast to create an editable table because it really is:
table.setEditable(true);
Take a look at the nice input components being automatically generated for us shown as follows:
Besides String
, Boolean
, and Date
types, an editable table also renders Item
types. Suppose we have a User
class as follows:
public class User { private String login; private...