public void addField(Object propertyId, Field<?> field) {
super.addField(propertyId, field);
field.setRequired(required);
field.setRequiredError("Missing required value!");
if (failValidator && !(field instanceof Button)) {
field.addValidator(new AlwaysFailValidator());
}
}
};
form.addField("Field", new TextField("Text"));