View Full Version : How to get to know if TextField is focused

24 Jan 2012, 2:31 AM

Is there any way in GXT to find out which component of FormPanel is focused?

24 Jan 2012, 3:53 AM
Somethings like that should work:

field.addListener(Events.Focus, new Listener<FieldEvent>(){ ...

24 Jan 2012, 4:27 AM
Thanks for replying, but it is not exactly what I want. I don't want my textfield to listen for focus event. I have a FormPanel with several textfields. I also have a KeyNav for the FormPanel. I want to have one action if one of my textfields is focused and another in the other way(on enter press). So, I need to get focused component from FormPanel or check if textfield is focused by it's own method...