Reputation: 3659
Is there a way to find out which component has the actual focus in a Vaadin window!?
Upvotes: 5
Views: 5224
Reputation: 11
You can add a focusListener and a blurListener to each component. If a component has focus you set an object to the current component, if blurListener gets called you set it to null.
If the object is != null you just need to check which component it is and you know which one has focus.
Upvotes: 1
Reputation: 7188
No, at least not directly (which is surprising). Please follow the links and discussions indicated in the thread on Vaadin forum.
You can go around it, but it will require certain amount of work. A starting point is the Focusable
interface. Basically, you should capture all focus events in all the components.
Upvotes: 2