Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Creating a custom bean id
Hi everyone,
I have the following container :
BeanContainer<Integer, Person> container = new BeanContainer<Integer, Person>(Person.class);
container.setBeanIdProperty("lastName");
Where person has a "lastName", "firstName" and "town" attributes.
I'm passing this container to my table :
table.setContainerDataSource(container);
The problem is that I want to have a bean id property value (called "fullname") that is the result of the lastname and firstname concatenation.
How can I do this wit the setTableFieldFactory and createField methods ?
Thank you.
Hi,
The quick solution I guess would be to define a method getFullName() in your bean and use "fullName" as a bean ID.
cheers,
aleksandr
I know ... but i'm experimenting the setTableFieldFactory :)
A field factory (as well as an overridden formatPropertyValue()) work on single properties. Furthermore, a TableFieldFactory just creates the field but its value is set separately later.
If you want to combine multiple properties, you can use a generated column (Table.addGeneratedColumn()).