I have a BeanFieldGroup
with several validators, and a Save
button that commits the form.
But if I have eg a @NotBlank
validation constraint on my entity, and the input field is empty by default, I already get an error icon beneath initially when showing the form.
- How can I prevent this?
- How can I then show the icons again if there are any validation errors on commit?
- Check if the BeanFieldGroup has any validation errors?
public class UserView {
private BeanFieldGroup<User> editor;
private Button saveBtn;
public UserView() {
saveBtn = new Button("Save", new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
try {
editor.commit();
} catch (CommitException e) {
e.printStackTrace();
}
}
});
}
}