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.
Grid BeanItemContainer Expand NestedBean property automatically
Hi All,
I have a Nested Entity
Person
-- name
-- Adress address
Address
-- city
I am using BeanItemContiner<Person> for my grid. Is it possible to tell gris to expand all the nested properties by itself, instead of telling it programatically ?
I want to show cols name, city in the grid. (column heading is not important, for this question)
Secondly, If it is indeed possible.
what happens in the scenario
Person
-- name
-- List<Adress> addressList
Does it works here aswell?
If for some reason there is no explicit functionality out of the box, can I somewhow use SingeAttribute property of the fields in my entity to achieve the same result?
thanks
Chahat
There is a chapter about this in our book, see it here https://vaadin.com/docs/-/part/framework/datamodel/datamodel-container.html
But my own practice is to usually avoid these. If I am starting to have more complex data model with nested beans, I would like to write simple DTO bean which is not nested and which I use in UI. I do the mapping between DTO and data store beans in the business logic. This way I am avoiding putting properties to container that I am not actually needing in the UI. This will optimize also the memory consumption of the application.
HI Tatu,
Thanks fro the reply, Actually I wanted to show my db schema on the UI, for which I was using table. I thought maybe there is a way where Vaadin could automatically expand the 1:1 nested beans so that I do not have to parse the fields of the model myself. But I guess there is no way around.
Thanks for your advice though, will keep ti in mind during implementation :)
thanks
Chahat