From df0b892b7117253631f5a831cf9370e9c781fda2 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Sun, 24 Jan 2016 21:19:08 +0200 Subject: Added JavaDoc for PropertyId Change-Id: I3a84c10612b1df5522941397b0e463c7401bfc2d --- .../src/com/vaadin/data/fieldgroup/PropertyId.java | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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}. + *

+ * 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. + *

+ * In following usage example, the text field would be bound to property "foo" + * in the Entity class. + *

+ *    class Editor extends FormLayout {
+        @PropertyId("foo")
+        TextField myField = new TextField();
+    }
+    
+    class Entity {
+        String foo;
+    }
+    
+    {
+        Editor e = new Editor();
+        BeanFieldGroup.bindFieldsUnbuffered(new Entity(), e);
+    }
+   
+ * + * + * @since 7.0 + * @author Vaadin Ltd + */ @Target({ ElementType.FIELD }) @Retention(RetentionPolicy.RUNTIME) public @interface PropertyId { -- cgit v1.2.3