I don't want to leave a "wrong" field

I need to verify the correct value of a field.
If the field is wrong the user shloudn’t be able to leave it in any way (excluding exit).
I tried with valueChange event but it fires only the first time (I mean when I change the value but, after, the value is wrong but it doesn’t fire anymore).
Could someone suggest a solution ?
Tks
Tullio

Maybe you could use a blur listener:

final TextField textField = new TextField();
textField.setImmediate(true);
textField.addBlurListener(new BlurListener() {

        public void blur(BlurEvent event) {
            setFocusedComponent(textField);
        }

});

I’ts not enough because blur doesn’t fire if I click on a button or change tab in a tabsheet.

Blur listener seems to fire. I checked with

textField.addBlurListener(new BlurListener() {
public void blur(BlurEvent event) {
Notification.show(“Blur listener”);
setFocusedComponent(textField);
}
});

Anyway, if you want to prevent your user to switch the tab, you can use a SelectedTabChangeListener. Your buttons can also check your textfield state before performing the action.

Quite difficult test on every button the validation of every field in a form, the same for tabs.
Tks