tags:

views:

91

answers:

1

How to tell if TextArea is selected or not. I want to save automatically when user changes the focus from TextArea.

I tried to look into addFocusHandler() and addBlurHandler() but couldn't figure out how to tell if it is selected or not.

A: 

I'd create a custom class that extends textarea and implement your call to save the data right there. Then use your custom class instead of the base class on the form you are building.

An example of a focuslistener: http://dev.vaadin.com/browser/versions/6.1/src/com/vaadin/terminal/gwt/client/ui/VTextField.java?rev=8544

Steve