Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get lost focus event in GWT

Tags:

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?

like image 681
user902383 Avatar asked Sep 17 '12 13:09

user902383


2 Answers

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

like image 142
Thomas Broyer Avatar answered Dec 15 '22 09:12

Thomas Broyer


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

textBox.addBlurHandler(new BlurHandler() {

    @Override
    public void onBlur(BlurEvent event) {
        // Your Code
    }
});
like image 23
Pritam Avatar answered Dec 15 '22 07:12

Pritam