* Required field.
*/
private boolean required = false;
-
+
/**
* The error message for the exception that is thrown when the field is
* required but empty.
return true;
}
-
+
/**
* Checks the validity of the Validatable by validating the field with all
* attached validators.
*
* The "required" validation is a built-in validation feature. If the field
- * is required, but empty, validation will throw an EmptyValueException
- * with the error message set with setRequiredError().
+ * is required, but empty, validation will throw an EmptyValueException with
+ * the error message set with setRequiredError().
*
* @see com.itmill.toolkit.data.Validatable#validate()
*/
try {
validate();
} catch (Validator.InvalidValueException e) {
- validationError = e;
+ if (!"".equals(e.getMessage())) {
+ validationError = e;
+ }
}
}
this.required = required;
requestRepaint();
}
-
+
public void setRequiredError(String requiredMessage) {
- this.requiredError = requiredMessage;
+ requiredError = requiredMessage;
requestRepaint();
}