Is this a bug or user error?
I thought maybe this was a pre-release issue, but I just upgraded to 24.5.0 and it’s still happening.
The error appear in the logs as soon as I load the page with the form.
2024-10-22T16:20:08.553-05:00 INFO 13423 --- [av-sync] [nio-8080-exec-4] com.vaadin.flow.data.binder.Binder : name does not have an accessible setter
2024-10-22T16:20:08.591-05:00 INFO 13423 --- [av-sync] [nio-8080-exec-4] com.vaadin.flow.data.binder.Binder : email does not have an accessible setter
2024-10-22T16:20:08.591-05:00 INFO 13423 --- [av-sync] [nio-8080-exec-4] com.vaadin.flow.data.binder.Binder : password does not have an accessible setter
public void addBindingAndValidation() {
BeanValidationBinder<UserDto> binder = new BeanValidationBinder<>(UserDto.class);
binder.bindInstanceFields(registrationForm);
binder.setStatusLabel(registrationForm.getErrorMessageField());
registrationForm.getSubmitButton().addClickListener(clickEvent -> {
try {
UserDto userDto = binder.writeRecord();
RichResult<Account> result = registerAccount.with(userDto);
result.handle(
// handle result
);
} catch (ValidationException exception) {
// validation errors are already visible for each field, and bean-level errors are shown in the status label.
registrationForm.getSubmitButton().setEnabled(true);
}
});
}
public record UserDto(
@NotBlank(message = "Name must not be blank.") String name,
@NotBlank(message = "Email must not be blank.") @Email(message = "Must use email format.") String email,
@NotBlank(message = "Password must not be blank.") String password
){}