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/tests | |
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/tests')
-rw-r--r-- | server/tests/src/com/vaadin/tests/server/component/fieldgroup/BeanFieldGroupTest.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/component/fieldgroup/BeanFieldGroupTest.java b/server/tests/src/com/vaadin/tests/server/component/fieldgroup/BeanFieldGroupTest.java new file mode 100644 index 0000000000..68c1133dc0 --- /dev/null +++ b/server/tests/src/com/vaadin/tests/server/component/fieldgroup/BeanFieldGroupTest.java @@ -0,0 +1,41 @@ +package com.vaadin.tests.server.component.fieldgroup; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import com.vaadin.data.fieldgroup.BeanFieldGroup; + +public class BeanFieldGroupTest { + + public static class MyBean { + + private MyNestedBean nestedBean = new MyNestedBean(); + + public MyNestedBean getNestedBean() { + return nestedBean; + } + } + + public static class MyNestedBean { + + private String hello = "Hello world"; + + public String getHello() { + return hello; + } + } + + @Test + public void buildAndBindNestedProperty() { + + MyBean bean = new MyBean(); + + BeanFieldGroup<MyBean> bfg = new BeanFieldGroup<MyBean>(MyBean.class); + bfg.setItemDataSource(bean); + + com.vaadin.ui.Field<?> helloField = bfg.buildAndBind("Hello string", + "nestedBean.hello"); + assertEquals(bean.nestedBean.hello, helloField.getValue().toString()); + } + +} |