@Override
public ErrorMessage getErrorMessage() {
// Reimplement the checking of validation error by using
// getErrorMessage() recursively instead of validate().
ErrorMessage validationError = null;
if (isValidationVisible()) {
for (final Iterator<Object> i = propertyIds.iterator(); i.hasNext();) {
Object f = fields.get(i.next());
if (f instanceof AbstractComponent) {
AbstractComponent field = (AbstractComponent) f;
validationError = field.getErrorMessage();
if (validationError != null) {
// Show caption as error for fields with empty errors
if ("".equals(validationError.toString())) {
validationError = new UserError(field.getCaption());
}
break;
} else if (f instanceof Field && !((Field<?>) f).isValid()) {
// Something is wrong with the field, but no proper