Hi all,
I am trying to use field validation on focus loss using the following approach:
@Autowired
TextField<String> field;
field.unwrap(FieldEvents.BlurNotifier.class).addBlurListener(l -> {
try {
field.validate
} catch(ValidationException e) {
notifications.create().withCaption("Validation error:").show();
}
});
However when closing the dialog editor with Cancel button and a call to “closeWithDiscard”, the focus loss validation is triggered and the validation error message is shown and editor window is not closed.
With ESC key the dialog closes without triggering validation.
I would like to have the cancel button action similar to the ESC key. Any idea how can I do that?
Thanks,
Samy