Can I have a VerticalLayout with components inside the cells of a Grid? (Va

Hello,

I would like to reproduce the layout in the picture with Vaadin 8. The number of check points is different every time which means that sometimes I have to have 3 rows sometimes 5 etc. Do you have an idea how could I build it? I tried to have a Grid with one column and inside every cell to put a VerticalLayout but it did not work.
41901.png

Hi,

instead of a Grid, have you tried just creating the layout using VerticalLayouts and HorizontalLayouts, or perhaps a GridLayout?

-Olli

Hi Olli,

I would like that the checkpoints would be dynamic. Every time that the user opens this View the number of the check points will differ.

How many check points I have, I take it from the database everytime so I would also like to set values and get values from these components.

thanks!

You should be able to create any number of components based on the information you get from the database.

-Olli

Hi Olli,

I tried to do it simple with a VerticalLayout and then inside every sell of the Vertical I have other layouts and that works good thanks!

Now I want to take the values from every component that is inside the VerticalLayout. How could I iterate all the components of the VerticalLayout and take their values in order to update my Database?

How about you define a
Binder
for you components, and add every component of which you want to save the value to the binder?

e.g. (substitute T for your class)

Binder<T> binder = new Binder<>(T.class);
...
binder.forField(new CheckBox())
.bind(T::isHilfeSet, T::setHilfeSet);

Thanks a lot Michael I will try it. I also found the methods getComponentCount() and getComponent( index ) from VerticalLayout and I can work with these too