]> source.dussan.org Git - vaadin-framework.git/commitdiff
#8153 Add BeanItem.addNestedProperty
authorArtur Signell <artur@vaadin.com>
Mon, 19 Dec 2011 13:39:12 +0000 (15:39 +0200)
committerArtur Signell <artur@vaadin.com>
Mon, 19 Dec 2011 14:40:55 +0000 (16:40 +0200)
src/com/vaadin/data/util/BeanItem.java

index 69fc4b2d951d83ef2c8090acf8e80ee3a8299e8d..94439471f538372ca88a916621c26fae55afae4a 100644 (file)
@@ -238,14 +238,25 @@ public class BeanItem<BT> extends PropertysetItem {
 
         for (String subproperty : subPropertySet) {
             String qualifiedPropertyId = propertyId + "." + subproperty;
-            addItemProperty(qualifiedPropertyId,
-                    new NestedMethodProperty<Object>(getBean(),
-                            qualifiedPropertyId));
+            addNestedProperty(qualifiedPropertyId);
         }
 
         removeItemProperty(propertyId);
     }
 
+    /**
+     * Adds a nested property to the item.
+     * 
+     * @param nestedPropertyId
+     *            property id to add. This property must not exist in the item
+     *            already and must of of form "field1.field2" where field2 is a
+     *            field in the object referenced to by field1
+     */
+    public void addNestedProperty(String nestedPropertyId) {
+        addItemProperty(nestedPropertyId, new NestedMethodProperty<Object>(
+                getBean(), nestedPropertyId));
+    }
+
     /**
      * Gets the underlying JavaBean object.
      *