diff options
author | Marc Englund <marc.englund@itmill.com> | 2009-07-10 11:50:23 +0000 |
---|---|---|
committer | Marc Englund <marc.englund@itmill.com> | 2009-07-10 11:50:23 +0000 |
commit | 03ac8c5d73d08b581ef827b909ccf3b9bd3592ee (patch) | |
tree | fd7ca761cbfed70ca878ba1b92e58f5921cf4a2d | |
parent | 09df9a5ed2fb613ec1541f1f31dda0cad41c79f2 (diff) | |
download | vaadin-framework-03ac8c5d73d08b581ef827b909ccf3b9bd3592ee.tar.gz vaadin-framework-03ac8c5d73d08b581ef827b909ccf3b9bd3592ee.zip |
TC for #3139
svn changeset:8370/svn branch:6.0
-rw-r--r-- | src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java b/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java new file mode 100644 index 0000000000..8f7f781684 --- /dev/null +++ b/src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java @@ -0,0 +1,57 @@ +package com.vaadin.tests.components.table; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Table; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; + +public class TableVisibleColumnsUpdate extends TestBase { + + private String[] cols1 = new String[] { "p1", "p2", "p3" }; + private String[] cols2 = new String[] { "p1", "p4", "p3" }; + private Table table; + + @Override + protected String getDescription() { + return "Columns should change between p1,p2,p3 and p1,p4,p3"; + } + + @Override + protected Integer getTicketNumber() { + return 3139; + } + + @Override + protected void setup() { + table = new Table(); + table.setWidth("400px"); + table.setHeight("100px"); + table.setPageLength(100); + table.addContainerProperty("p1", String.class, null); + table.addContainerProperty("p2", String.class, null); + table.addContainerProperty("p3", String.class, null); + table.addContainerProperty("p4", String.class, null); + + for (int i = 0; i < 10; i++) { + table.addItem(new Object[] { "a" + i, "b" + i, "c" + i, "X" + i }, + "" + i); + } + + addComponent(table); + + table.setVisibleColumns(cols1); + // table.setColumnHeaders(headers1); + + Button updateButton = new Button("Change columns", new ClickListener() { + private boolean one = true; + + public void buttonClick(ClickEvent event) { + table.setVisibleColumns((one ? cols2 : cols1)); + one = !one; + } + }); + addComponent(updateButton); + } + +} |