summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/data
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-09-24 17:56:36 +0300
committerVaadin Code Review <review@vaadin.com>2014-09-26 12:40:14 +0000
commit99b1c1a7936f250885e647983d7e30fd3a7f1018 (patch)
tree51141abb0ed9c1dbca20b31702ab014a559a377e /server/src/com/vaadin/data
parentd516791e28e861893fb5082472a1c0ca59f0dfd7 (diff)
downloadvaadin-framework-99b1c1a7936f250885e647983d7e30fd3a7f1018.tar.gz
vaadin-framework-99b1c1a7936f250885e647983d7e30fd3a7f1018.zip
Add clear() for fields and field group (#14755)
Change-Id: If9372ccceeaacd0826f8b1ed07f64af12bf47fc6
Diffstat (limited to 'server/src/com/vaadin/data')
-rw-r--r--server/src/com/vaadin/data/fieldgroup/FieldGroup.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/server/src/com/vaadin/data/fieldgroup/FieldGroup.java b/server/src/com/vaadin/data/fieldgroup/FieldGroup.java
index e647bdbf6d..2873d07c5d 100644
--- a/server/src/com/vaadin/data/fieldgroup/FieldGroup.java
+++ b/server/src/com/vaadin/data/fieldgroup/FieldGroup.java
@@ -28,6 +28,7 @@ import com.vaadin.data.Item;
import com.vaadin.data.Property;
import com.vaadin.data.Validator.InvalidValueException;
import com.vaadin.data.util.TransactionalPropertyWrapper;
+import com.vaadin.ui.AbstractField;
import com.vaadin.ui.DefaultFieldFactory;
import com.vaadin.ui.Field;
import com.vaadin.ui.Form;
@@ -1095,4 +1096,18 @@ public class FieldGroup implements Serializable {
}
return memberFieldInOrder;
}
+
+ /**
+ * Clears the value of all fields.
+ *
+ * @since
+ */
+ public void clear() {
+ for (Field<?> f : getFields()) {
+ if (f instanceof AbstractField) {
+ ((AbstractField) f).clear();
+ }
+ }
+
+ }
}