Vaadin Checking which component has focus

Is there any way to find out which component has the actual focus in the Vaadin window !?

+4
source share
2 answers

No, at least not directly (which is surprising). Please follow the links and discussions provided in the section on the Vaadin forum .

You can get around this, but it will take some work. The starting point is the Focusable interface . Basically, you should capture all the focal events in all components.

+2
source

You can add focusListener and blurListener for each component. If the component has focus, you set the object for the current component, if the blurListener receives the call, you set it to zero.

If the object is! = Null, you just need to check which component it is, and you know which one has focus.

+1
source

All Articles