Table Data Source

Hi,

I want to create a vaadin table with 2 domain classes with using column generator, Can I do that? ,If can this is the my problem

There two classes called “Person” “Company” ,I want to put those object’s attributes in a single table ,Table columns would be ( empName, age, ComName, department),
I set the data source as “Person” ,I want to add Company columns to the table ,How can I do that ? Could any one help me to get out this ? ,If i’m mistaken pls correct me ,

Thanxxx,

Sure, you could do that with a ColumnGenerator. The Book has basic documentation and there’s one example
here
.

Another approach would to have a composite wrapper bean for the Person-Company pairs, such as “PersonCompany”, that has getters to access both beans. Then, put those in a BeanItemContainer and use addNestedContainerProperty() to add the columns for the properties you want to have in the table. See
this example
. Well, you could also just make delegation getters from the composite to the getters of the nested beans.


Update: Corrected broken links.

Thank you !! i’ll take a look to those examples .

Hi could you give me exact examples,link page shows another link set :frowning: