summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@itmill.com>2009-03-24 14:19:39 +0000
committerHenri Sara <henri.sara@itmill.com>2009-03-24 14:19:39 +0000
commitf65586e992add15e7d89c251ed8bee45aa5cfcfe (patch)
tree646255263760e73c79dc6a7164bca6d920f4e05b
parent97dfd2975e41f2d4b20dd9d35ee2922c33952381 (diff)
downloadvaadin-framework-f65586e992add15e7d89c251ed8bee45aa5cfcfe.tar.gz
vaadin-framework-f65586e992add15e7d89c251ed8bee45aa5cfcfe.zip
Test case that was missing from merge of #2799 to 6.0.
svn changeset:7164/svn branch:6.0
-rw-r--r--src/com/itmill/toolkit/tests/components/table/RowAdditionTest.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/tests/components/table/RowAdditionTest.java b/src/com/itmill/toolkit/tests/components/table/RowAdditionTest.java
new file mode 100644
index 0000000000..b01abd62c0
--- /dev/null
+++ b/src/com/itmill/toolkit/tests/components/table/RowAdditionTest.java
@@ -0,0 +1,59 @@
+package com.itmill.toolkit.tests.components.table;
+
+import com.itmill.toolkit.data.Item;
+import com.itmill.toolkit.data.util.IndexedContainer;
+import com.itmill.toolkit.tests.components.TestBase;
+import com.itmill.toolkit.ui.Button;
+import com.itmill.toolkit.ui.HorizontalLayout;
+import com.itmill.toolkit.ui.Table;
+import com.itmill.toolkit.ui.Button.ClickEvent;
+
+public class RowAdditionTest extends TestBase {
+
+ @Override
+ protected String getDescription() {
+ return "Adding a row should refresh client area only if newly added row is in the rendered area.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return new Integer(2799);
+ }
+
+ @Override
+ protected void setup() {
+ final Table table = new Table();
+ final IndexedContainer container = (IndexedContainer) table
+ .getContainerDataSource();
+ table.addContainerProperty("column1", String.class, "test");
+
+ for (int i = 0; i < 100; ++i) {
+ table.addItem();
+ }
+
+ HorizontalLayout hl = new HorizontalLayout();
+ hl.addComponent(new Button("Add first", new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ Item item = container.addItemAt(0, new Object());
+ item.getItemProperty("column1").setValue("0");
+ }
+ }));
+ hl.addComponent(new Button("Add at position 50",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ Item item = container.addItemAt(50, new Object());
+ item.getItemProperty("column1").setValue("50");
+ }
+ }));
+ hl.addComponent(new Button("Add at position 100",
+ new Button.ClickListener() {
+ public void buttonClick(ClickEvent event) {
+ Item item = container.addItemAt(100, new Object());
+ item.getItemProperty("column1").setValue("100");
+ }
+ }));
+
+ getLayout().addComponent(table);
+ getLayout().addComponent(hl);
+ }
+}