aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2016-08-18 09:46:14 +0300
committerVaadin Code Review <review@vaadin.com>2016-08-18 08:09:43 +0000
commit78c6ab1852f18b142390b8852e5c10e1f017dd8f (patch)
tree1fb7bad65d1ded3e7b2095630a412294d4b446fe /server/src/main
parent97e4ef4aa5bd56ca46ac477c1be33d44411aca17 (diff)
downloadvaadin-framework-78c6ab1852f18b142390b8852e5c10e1f017dd8f.tar.gz
vaadin-framework-78c6ab1852f18b142390b8852e5c10e1f017dd8f.zip
Binding.validate() should fire a validation status event (#134).
Change-Id: I2121ec8f90ffcdf2fdfa02bf99084b539b27180e
Diffstat (limited to 'server/src/main')
-rw-r--r--server/src/main/java/com/vaadin/data/Binder.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/src/main/java/com/vaadin/data/Binder.java b/server/src/main/java/com/vaadin/data/Binder.java
index 4230bd379a..d4501955d6 100644
--- a/server/src/main/java/com/vaadin/data/Binder.java
+++ b/server/src/main/java/com/vaadin/data/Binder.java
@@ -485,6 +485,7 @@ public class Binder<BEAN> implements Serializable {
FIELDVALUE fieldValue = field.getValue();
Result<TARGET> dataValue = converterValidatorChain.convertToModel(
fieldValue, ((AbstractComponent) field).getLocale());
+ fireStatusChangeEvent(dataValue);
return dataValue;
}
@@ -554,7 +555,7 @@ public class Binder<BEAN> implements Serializable {
return newBinding;
}
- private void fireStatusChangeEvent(Result<?> result) {
+ private void fireStatusChangeEvent(Result<TARGET> result) {
ValidationStatusChangeEvent event = new ValidationStatusChangeEvent(
getField(),
result.isError() ? ValidationStatus.ERROR
@@ -716,7 +717,6 @@ public class Binder<BEAN> implements Serializable {
List<ValidationError<?>> resultErrors = new ArrayList<>();
for (BindingImpl<BEAN, ?, ?> binding : bindings) {
Result<?> result = binding.validate();
- binding.fireStatusChangeEvent(result);
result.ifError(errorMessage -> resultErrors
.add(new ValidationError<>(binding.field, errorMessage)));
}