PDA

View Full Version : GXT Text Area default focus



ramnathlikesu
31 Aug 2011, 12:42 PM
Hi,

I am new to GXT.
I want to set the default focus on GXT TextArea. I am using TextArea in a Dialog. When ever user clicks on Button, Dialog box will be displayed and by default cursor should be displayed in the TextArea to enter the text.

I tried with TextArea.focus() method. But, its not working.
I am using GXT API 2.1.1.

Please help me in this.

Thank you...
Regards,
Ramnath R

Colin Alworth
2 Sep 2011, 9:24 AM
Instead of directing the widget to be focused every time it is displayed, tell the Dialog to focus on that widget whenever the Dialog is show()n. Dialog's superclass Window has a method setFocusWidget(Widget) which indicates that the given widget should be focused when show() is called on the window.

ramnathlikesu
8 Sep 2011, 9:56 AM
Hi,

Thanks for your help. It solved my problem.

Regards,
Ramnath R