diff options
Diffstat (limited to 'src/com/vaadin/ui')
-rw-r--r-- | src/com/vaadin/ui/AbstractField.java | 12 | ||||
-rw-r--r-- | src/com/vaadin/ui/Form.java | 17 |
2 files changed, 19 insertions, 10 deletions
diff --git a/src/com/vaadin/ui/AbstractField.java b/src/com/vaadin/ui/AbstractField.java index 82d3d2af19..742d39d835 100644 --- a/src/com/vaadin/ui/AbstractField.java +++ b/src/com/vaadin/ui/AbstractField.java @@ -26,6 +26,7 @@ import com.vaadin.data.util.converter.ConverterFactory; import com.vaadin.event.Action; import com.vaadin.event.ShortcutAction; import com.vaadin.event.ShortcutListener; +import com.vaadin.terminal.AbstractErrorMessage; import com.vaadin.terminal.CompositeErrorMessage; import com.vaadin.terminal.ErrorMessage; import com.vaadin.terminal.PaintException; @@ -1125,7 +1126,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements * the requiredError string. For these fields the exclamation mark will * be hidden but the error must still be sent to the client. */ - ErrorMessage validationError = null; + Validator.InvalidValueException validationError = null; if (isValidationVisible()) { try { validate(); @@ -1146,8 +1147,13 @@ public abstract class AbstractField<T> extends AbstractComponent implements } // Throw combination of the error types - return new CompositeErrorMessage(new ErrorMessage[] { superError, - validationError, getCurrentBufferedSourceException() }); + return new CompositeErrorMessage( + new ErrorMessage[] { + superError, + AbstractErrorMessage + .getErrorMessageForException(validationError), + AbstractErrorMessage + .getErrorMessageForException(getCurrentBufferedSourceException()) }); } diff --git a/src/com/vaadin/ui/Form.java b/src/com/vaadin/ui/Form.java index 1abfefbc58..a66c8e723b 100644 --- a/src/com/vaadin/ui/Form.java +++ b/src/com/vaadin/ui/Form.java @@ -24,10 +24,12 @@ import com.vaadin.event.Action; import com.vaadin.event.Action.Handler; import com.vaadin.event.Action.ShortcutNotifier; import com.vaadin.event.ActionManager; +import com.vaadin.terminal.AbstractErrorMessage; import com.vaadin.terminal.CompositeErrorMessage; import com.vaadin.terminal.ErrorMessage; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.PaintTarget; +import com.vaadin.terminal.UserError; import com.vaadin.terminal.gwt.client.ui.FormConnector; /** @@ -242,15 +244,13 @@ public class Form extends AbstractField<Object> implements Item.Editor, if (validationError != null) { // Show caption as error for fields with empty errors if ("".equals(validationError.toString())) { - validationError = new Validator.InvalidValueException( - field.getCaption()); + validationError = new UserError(field.getCaption()); } break; } else if (f instanceof Field && !((Field<?>) f).isValid()) { // Something is wrong with the field, but no proper // error is given. Generate one. - validationError = new Validator.InvalidValueException( - field.getCaption()); + validationError = new UserError(field.getCaption()); break; } } @@ -264,9 +264,12 @@ public class Form extends AbstractField<Object> implements Item.Editor, } // Throw combination of the error types - return new CompositeErrorMessage(new ErrorMessage[] { - getComponentError(), validationError, - currentBufferedSourceException }); + return new CompositeErrorMessage( + new ErrorMessage[] { + getComponentError(), + validationError, + AbstractErrorMessage + .getErrorMessageForException(currentBufferedSourceException) }); } /** |