aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/fields/FormOneToMany.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/fields/FormOneToMany.java')
-rw-r--r--uitest/src/com/vaadin/tests/fields/FormOneToMany.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/fields/FormOneToMany.java b/uitest/src/com/vaadin/tests/fields/FormOneToMany.java
new file mode 100644
index 0000000000..a010e935ab
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/fields/FormOneToMany.java
@@ -0,0 +1,43 @@
+package com.vaadin.tests.fields;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Millionaire;
+import com.vaadin.ui.Form;
+
+public class FormOneToMany extends TestBase {
+
+ @Override
+ protected void setup() {
+ final Form form = new Form();
+ addComponent(form);
+ form.setItemDataSource(createMillionaireItem());
+
+ // TODO support adding, editing and removing secondary addresses
+ }
+
+ protected BeanItem<Millionaire> createMillionaireItem() {
+ Millionaire person = new Millionaire("First", "Last", "foo@vaadin.com",
+ "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");
+
+ BeanItem<Millionaire> item = new BeanItem<Millionaire>(person);
+ // add nested properties from address
+ item.expandProperty("address");
+
+ // TODO for now, hide secondary residences
+ item.removeItemProperty("secondaryResidences");
+
+ return item;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Form with an editable list of sub-objects.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}