Hi,
I am adding elements to a TreeTable, but all I get are the rows without any text.
I’ll provide examples to clarify (simplified code):
First I add container properties, set the visible columns and the headers:
addContainerProperty("name", String.class, null);
addContainerProperty("surname", String.class, null);
setVisibleColumns("name", "surname");
setColumnHeaders("Name", "Surname");
The class Person:
[code]
private final class Person {
private final String name;
private final String surname;
// getters and setters
}
[/code]Then I add the elements in a loop like this:
Person elem = new Person("nameX", "surnameX");
addItem(elem);
This gives me a TreeTable with as many rows as elements I add, but everything is blank.
If instead I add the items as Object, then it works:
addItem(new Object{"nameX", "surnameX"}, "itemid");
The question is: is it not possible to use beans as items in TreeTables? If it is, what am I doing wrong?