aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti@vaadin.com>2016-01-24 21:19:08 +0200
committerVaadin Code Review <review@vaadin.com>2016-02-02 14:44:33 +0000
commitdd45e4f8e784fdbfd15828ad043a943954eb9047 (patch)
tree40c9eeb3bdcd0bcf0afafa05ec79b83911610245
parent35e59f47732413cbcc4c8f5fc6a7082b70cc5550 (diff)
downloadvaadin-framework-dd45e4f8e784fdbfd15828ad043a943954eb9047.tar.gz
vaadin-framework-dd45e4f8e784fdbfd15828ad043a943954eb9047.zip
Added JavaDoc for PropertyId
Change-Id: I78d14f3936b4a01f1decd079eb4ac4010a5635d2
-rw-r--r--server/src/com/vaadin/data/fieldgroup/PropertyId.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/server/src/com/vaadin/data/fieldgroup/PropertyId.java b/server/src/com/vaadin/data/fieldgroup/PropertyId.java
index c38af0e89b..e7fe50305e 100644
--- a/server/src/com/vaadin/data/fieldgroup/PropertyId.java
+++ b/server/src/com/vaadin/data/fieldgroup/PropertyId.java
@@ -20,6 +20,39 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+/**
+ * Defines the custom property name to be bound to a {@link Field} using
+ * {@link FieldGroup} or {@link BeanFieldGroup}.
+ * <p>
+ * The automatic data binding in FieldGroup and BeanFieldGroup relies on a
+ * naming convention by default: properties of an item are bound to similarly
+ * named field components in given a editor object. If you want to map a
+ * property with a different name (ID) to a {@link com.vaadin.client.ui.Field},
+ * you can use this annotation for the member fields, with the name (ID) of the
+ * desired property as the parameter.
+ * <p>
+ * In following usage example, the text field would be bound to property "foo"
+ * in the Entity class. <code>
+ * <pre>
+ * class Editor extends FormLayout {
+ &#64;PropertyId("foo")
+ TextField myField = new TextField();
+ }
+
+ class Entity {
+ String foo;
+ }
+
+ {
+ Editor e = new Editor();
+ BeanFieldGroup.bindFieldsUnbuffered(new Entity(), e);
+ }
+ </pre>
+ * </code>
+ *
+ * @since 7.0
+ * @author Vaadin Ltd
+ */
@Target({ ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
public @interface PropertyId {