Focus and panel - how to

I’ve a panel with scrollbars with many textfields in it.
I need to set the focus on a given field and I use .focus().
Everythig is OK when the field is in the visible part of the panel but if I try to do the same operation when the field is not in the visible part of the panel nothing evident happens.
I believe the focus is set in the correct field but I hoped the focused field would be shown and it didn’t happen.
Could someone suggest a workaround ?


try calling com.vaadin.ui.UI.scrollIntoView(Component) with the target textfield as the parameter.


It doesn’t seem to work.
It still shows the page from the beginning.
I used
The component is a checkbox in this case.

To be more precise myComponent is a layout containing a checkbox.