summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2011-11-29 16:28:58 +0000
committerArtur Signell <artur.signell@itmill.com>2011-11-29 16:28:58 +0000
commit94ec2f3753b101e17ce0284b119d6b9860a14c3a (patch)
treeb248e73da3a0a3dc30b5aa918df9727b3160d03d
parent23dd45f562cada36e0ab45aec5f9d06d863ba757 (diff)
downloadvaadin-framework-94ec2f3753b101e17ce0284b119d6b9860a14c3a.tar.gz
vaadin-framework-94ec2f3753b101e17ce0284b119d6b9860a14c3a.zip
Test for #6902
svn changeset:22183/svn branch:6.7
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java
new file mode 100644
index 0000000000..254f1b0a90
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java
@@ -0,0 +1,52 @@
+package com.vaadin.tests.components.table;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class TextFieldValueGoesMissing extends TestBase {
+
+ @Override
+ protected void setup() {
+ final VerticalLayout verticalLayout = new VerticalLayout();
+
+ final Label label1 = new Label("1");
+ final Label label2 = new Label("2");
+
+ Button button = new Button("Refresh");
+ button.addListener(new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ verticalLayout.replaceComponent(label1, label2);
+ }
+ });
+ verticalLayout.addComponent(button);
+ verticalLayout.addComponent(label1);
+
+ Table table = new Table();
+ table.addContainerProperty("Field", TextField.class, null);
+ Object id = table.addItem();
+ TextField tf = new TextField();
+ table.getItem(id).getItemProperty("Field").setValue(tf);
+
+ verticalLayout.addComponent(table);
+
+ addComponent(verticalLayout);
+
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Enter a text in the TextField in the table and press the 'replace label' button. This replaces the label which is in the same layout as the table but should not cause the TextField in the table to lose its contents";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 6902;
+ }
+
+}