Validator timing.

I didn’t understand well when an added validator fires and verify if the field is correct.
Could someone provide me an idea about the validator timing ?
When is it fired ? at focus blur ? when the value is changed ? only after an explicit field validation ?
Tks
Tullio

Validation occurs when the field tries to set a new value for itself. To elaborate this a bit, when you change the value of a, let’s say, a TextField, the new value is sent to the server on blur GIVEN that the field is set to setImmediate(true). When the field receives the value change event, calls setValue(object, boolean), which is a protected method. First the setValue method will apply any possible converters to the new value. If those pass, then the component will apply validation. If the validation passes, then the field’s value is updated.

If setImmediate is false, then the validation will be triggered the next time there is an HTTP request going to the server - so in other words, when there is an event occuring in any other immediate component in the UI.

You can also trigger the validation explicitly, for example, by calling validate() or isValid(). Doing commit() to a field will also implicitly trigger validation.

When setValidationVisible() is true, as it is by default, validation is run 1) after field is edited by the user, on the next server request, 2) when the field value is modified programmatically on the server-side. If the field has setImmediate(true), the server request occurs on blur, if false, when some other user interaction causes a server request.

If setValidationVisible() is false, validation needs to be done explicitly with validate() (or commit()).

Tks, understood but the only effect I see is the field is marked as “error”.
The field loose the focus and every other operation is connected with the clicked object (e.g. Button click, Tab change) is executed.
I need to interrupt every operations on error.
How can I solve and wait the user insert a correct value before leave the field?
Tks