diff options
author | John Ahlroos <john@vaadin.com> | 2013-02-28 12:07:35 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-02-28 10:43:24 +0000 |
commit | 860876d311fdc42174590ed816b0b09f243362e6 (patch) | |
tree | 4687fe03fa88fb5866374db919e119d2c67080d3 /server/src | |
parent | 7b68e8e52104156f04e5a0e69045376a1125a3c7 (diff) | |
download | vaadin-framework-860876d311fdc42174590ed816b0b09f243362e6.tar.gz vaadin-framework-860876d311fdc42174590ed816b0b09f243362e6.zip |
Fixed BindException when binding nested properties with BeanFieldGroup.buildAndBind() #11009
Change-Id: I9bf646b7d8b767c78506a62185ce5dca9dcae7ad
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java b/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java index 7e44c26c9e..b0d03af8d6 100644 --- a/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java +++ b/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java @@ -110,8 +110,7 @@ public class BeanFieldGroup<T> extends FieldGroup { return (BeanItem<T>) super.getItemDataSource(); } - @Override - public void bind(Field field, Object propertyId) { + private void ensureNestedPropertyAdded(Object propertyId) { if (getItemDataSource() != null) { // The data source is set so the property must be found in the item. // If it is not we try to add it. @@ -123,11 +122,22 @@ public class BeanFieldGroup<T> extends FieldGroup { getItemDataSource().addNestedProperty((String) propertyId); } } + } + @Override + public void bind(Field field, Object propertyId) { + ensureNestedPropertyAdded(propertyId); super.bind(field, propertyId); } @Override + public Field<?> buildAndBind(String caption, Object propertyId) + throws BindException { + ensureNestedPropertyAdded(propertyId); + return super.buildAndBind(caption, propertyId); + } + + @Override protected void configureField(Field<?> field) { super.configureField(field); // Add Bean validators if there are annotations |