summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tickets/Ticket1632.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/tests/tickets/Ticket1632.java')
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket1632.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1632.java b/uitest/src/com/vaadin/tests/tickets/Ticket1632.java
new file mode 100644
index 0000000000..bca902a73f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket1632.java
@@ -0,0 +1,65 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.Item;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.UI.LegacyWindow;
+import com.vaadin.ui.Table;
+
+/**
+ */
+public class Ticket1632 extends Application.LegacyApplication {
+
+ private Table t;
+
+ @Override
+ public void init() {
+
+ final LegacyWindow mainWin = new LegacyWindow("Test app");
+ setMainWindow(mainWin);
+
+ t = new Table();
+
+ t.addContainerProperty("col1", String.class, "");
+ t.addContainerProperty("col2", String.class, "");
+ t.addContainerProperty("col3", String.class, "");
+
+ t.addItem(new Object[] { "jep", "foo", "bar" }, "1");
+ t.addItem(new Object[] { "jep", "foo", "bar" }, "2");
+ t.addItem(new Object[] { "jep", "foo", "bar" }, "3");
+
+ t.setVisibleColumns(new Object[] { "col1", "col2" });
+
+ t.addItem(new Object[] { "foo", "bar" }, "4");
+
+ // workaround to add item with all values
+ Item i = t.addItem("5");
+ i.getItemProperty("col1").setValue("jep");
+ i.getItemProperty("col2").setValue("foo");
+ i.getItemProperty("col3").setValue("bar");
+
+ mainWin.addComponent(t);
+
+ Button b = new Button("Toggle col3");
+ b.addListener(new Button.ClickListener() {
+ boolean visible = false;
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ visible = !visible;
+ if (visible) {
+ t.setVisibleColumns(new Object[] { "col1", "col2", "col3" });
+
+ } else {
+ t.setVisibleColumns(new Object[] { "col1", "col2" });
+
+ }
+
+ }
+ });
+
+ mainWin.addComponent(b);
+
+ }
+} \ No newline at end of file