use of com.vaadin.server.ErrorMessage in project VaadinUtils by rlsutton1.
the class ReportParameter method validateField.
protected boolean validateField(AbstractField<T> field) {
boolean valid = false;
try {
field.setComponentError(null);
if (validateListener != null) {
validateListener.setComponentError(null);
}
field.validate();
valid = true;
} catch (final InvalidValueException e) {
ErrorMessage componentError = new ErrorMessage() {
private static final long serialVersionUID = -2976235476811651668L;
@Override
public String getFormattedHtmlMessage() {
return e.getHtmlMessage();
}
@Override
public ErrorLevel getErrorLevel() {
return ErrorLevel.ERROR;
}
};
field.setComponentError(componentError);
if (validateListener != null) {
validateListener.setComponentError(componentError);
}
}
return valid;
}
Aggregations