user902383
user902383

Reputation: 8640

How to get lost focus event in GWT

I have a TextBox, and I want to do something with content after box will lose focus.
in older versions of GWT I could use FocusListener (it has methods onFocus and onLostFocus). But t is deprecated and replaced by FocusHandler.
Is FocusHandler can handle lost focus event? and how I can distinguish them from onFocus?

Upvotes: 7

Views: 13544

Answers (2)

Thomas Broyer
Thomas Broyer

Reputation: 64551

As always, the javadoc points to the replacement class(es), in this case BlurHandler.

Upvotes: 18

Pritam
Pritam

Reputation: 81

In GWT we use BlurHandler for focus lost, such as below:

textBox.addBlurHandler(new BlurHandler() {

    @Override
    public void onBlur(BlurEvent event) {
        // Your Code
    }
});

Upvotes: 8

Related Questions