Vaadin-flow non-critical validation that still returns isValid=true

we are currently trying to implement a non-critical validation layer that checks field inputs against certain validators without marking the form as "not valid", but rather as "out of specification" so that we can highlight the fields to the user. In particular we are talking about number ranges with lower and upper boundaries that should highlight the input fields as some sort of "out of specification" warning. The input itself is considered valid but "out of specifaction" while the user should still be able to save the data.

Here's an example:

  • allowed input of any integer (validation), with an input specification of integers between 90 and 100 (specification).
  • input "abc" -> wrong input type -> error message, saving not allowed
  • input "95.1234" -> wrong input type -> error message, saving not allowed
  • input "85" -> correct input type, valid input, but out of specification -> warning message, saving still allowed
  • input "95" -> correct input type, valid input, in specification -> saving allowed

This means the normal binder validation should still block the saving while the additional non-critical validation should just highlight it, but not block it.

We are currently using the vaadin binder in vaadin version 14 and are using the features of converters and validators. Is there a possibility to add our layer to the vaadin binder so that it performs fluently with our current usage? Or do we have to build our own non-critical validation layer additionally to the normal vaadin binder usage? In an ideal world we would pin it after conversion and validation phase:

  1. field input
  2. type conversion
  3. critical validation
  4. non-critical validation
  5. input saving

I hope my description is sufficient. If there are any questions, just let me know and I try to describe it a little bit more detailed. Thanks in advance.


That's possible with errors that are not of type ErrorLevel.ERROR with a custom BinderValidationErrorHandler available since flow 14.7.

See the PR that introduced it with an example https://github.com/vaadin/flow/pull/11384#issuecomment-879309037