I defined a form with a lot of fields, and used a binder to bind them. However, when running binder.validate(), I couldn’t get the detailed errors of which fields get wrong. Any ways that I can display to user which fields got what errors?
Not 100% if I understood your problem correctly, but what about binder.validate().getFieldValidationErrors()? From that list you can iterate through all field related errors and can also show for each error the validation results with error message and level plus the related field.
for (BindingValidationStatus<?> fieldValidationError : binder.validate().getFieldValidationErrors()) {
HasValue<?, ?> field = fieldValidationError.getField();
for (ValidationResult validationResult : fieldValidationError.getValidationResults()) {
String errorMessage = validationResult.getErrorMessage();
// ...
}
}