Hello,
i’ve got difficulties to set a form field manually as required:
formFactory.setFieldProvider("userName", user -> {
var textFieldUser = new TextField();
textFieldUser.setLabel("Name");
textFieldUser.setRequired(true);
textFieldUser.setRequiredIndicatorVisible(true);
textFieldUser.setErrorMessage("This field is required");
return textFieldUser;
});
The blue dot appears, indicating that the field is required, but when I push “Add” on the form, the required is ignored and the form closes saying item saved.
What am I doing wrong? I don’t want to update the model class with @NotNull.
Thanks for your help!