diff options
author | Jonatan Kronqvist <jonatan.kronqvist@itmill.com> | 2011-09-16 07:22:06 +0000 |
---|---|---|
committer | Jonatan Kronqvist <jonatan.kronqvist@itmill.com> | 2011-09-16 07:22:06 +0000 |
commit | 8993a9d1e6fc7ed7045961d95a0ce4d1a462af71 (patch) | |
tree | 5716677db1157da27d291494f0da148bbe1e882a /tests | |
parent | 3bb05353f4d2e4affb622f311d2a74cbe37d7bf1 (diff) | |
download | vaadin-framework-8993a9d1e6fc7ed7045961d95a0ce4d1a462af71.tar.gz vaadin-framework-8993a9d1e6fc7ed7045961d95a0ce4d1a462af71.zip |
Fix for out of sync problem in generated columns in tree table #7620
svn changeset:21070/svn branch:6.7
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.html | 37 | ||||
-rw-r--r-- | tests/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java | 53 |
2 files changed, 90 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.html b/tests/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.html new file mode 100644 index 0000000000..b8d6cdb22e --- /dev/null +++ b/tests/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.html @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>TreeTableOutOfSync</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">TreeTableOutOfSync</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.treetable.TreeTableOutOfSync?restartApplication</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableOutOfSync::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>10,7</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableOutOfSync::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>verifyTextNotPresent</td> + <td>Something has caused us to be out of sync with the server.<br />Take note of any unsaved data, and click here to re-sync.</td> + <td></td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java b/tests/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java new file mode 100644 index 0000000000..09b42cce31 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java @@ -0,0 +1,53 @@ +/* +@ITMillApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.components.treetable; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Table; +import com.vaadin.ui.TreeTable; + +public class TreeTableOutOfSync extends TestBase { + + @Override + protected void setup() { + TreeTable tt = new TreeTable(); + tt.addContainerProperty("i", Integer.class, null); + tt.addGeneratedColumn("text", new Table.ColumnGenerator() { + public Object generateCell(Table source, Object itemId, + Object columnId) { + if ("text".equals(columnId)) { + Button button = new Button("text " + + source.getContainerDataSource().getItem(itemId) + .getItemProperty("i").getValue()); + button.addListener(new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + getMainWindow().showNotification("click"); + } + }); + return button; + } + return null; + } + }); + + Object item1 = tt.addItem(new Object[] { 1 }, null); + Object item2 = tt.addItem(new Object[] { 2 }, null); + tt.addItem(new Object[] { 3 }, null); + tt.setParent(item2, item1); + + addComponent(tt); + } + + @Override + protected String getDescription() { + return "When a root node is expanded, components created by a column generator go out of sync"; + } + + @Override + protected Integer getTicketNumber() { + return 7620; + } +} |