aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui/Form.java
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2012-03-14 12:32:21 +0200
committerArtur Signell <artur@vaadin.com>2012-03-21 17:42:34 +0200
commite905f033ff2b2aa094b51eae72fef63e68bd1800 (patch)
tree4d81f4d1e1bd5a7c0b1a356905f328ec5059c5c2 /src/com/vaadin/ui/Form.java
parentead998ecf701bb270ac810ab76af48484d9b1296 (diff)
downloadvaadin-framework-e905f033ff2b2aa094b51eae72fef63e68bd1800.tar.gz
vaadin-framework-e905f033ff2b2aa094b51eae72fef63e68bd1800.zip
Refactor error messages on server side (#8437).
This is an intermediate step towards moving error messages from UIDL to shared state.
Diffstat (limited to 'src/com/vaadin/ui/Form.java')
-rw-r--r--src/com/vaadin/ui/Form.java17
1 files changed, 10 insertions, 7 deletions
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) });
}
/**