How to get the index position of a component in layout

Hi,

in vaadin 8 it was possible to get the index of a component in a layout ( layout.getComponentIndex(component) )

How is it possible in vaadin 14 ?

Thanks

What you are looking for is the method layout.indexOf(component);. This method is defined in the interface com.vaadin.flow.component.HasOrderedComponents, which for example VerticalLayout and HorizontalLayout are implementing.

Kaspar Scherrer:
What you are looking for is the method layout.indexOf(component);. This method is defined in the interface HasOrderedComponents, which for example VerticalLayout and HorizontalLayout are implementing.

Perfect, thanks