diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2013-02-14 13:15:34 +0000 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-02-14 13:15:34 +0000 |
commit | 655a44cadffb2fc0f4d94327582c6611126be8ad (patch) | |
tree | 9726648f7a025454bcd6259ed01f7ff72906784e /uitest/src | |
parent | 35571f0f3e11595e0306cfbe158682f0c370ca4c (diff) | |
parent | 7a111fc541dcc507032cdad6799b477df6d4833f (diff) | |
download | vaadin-framework-655a44cadffb2fc0f4d94327582c6611126be8ad.tar.gz vaadin-framework-655a44cadffb2fc0f4d94327582c6611126be8ad.zip |
Merge "Merge of (#6160) and (#10470) to Vaadin 7." into 7.0
Diffstat (limited to 'uitest/src')
6 files changed, 550 insertions, 66 deletions
diff --git a/uitest/src/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java b/uitest/src/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java new file mode 100644 index 0000000000..c1ae9b4118 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/EmptyRowsWhenScrolling.java @@ -0,0 +1,275 @@ +package com.vaadin.tests.components.table; + +import java.util.Random; + +import com.vaadin.annotations.AutoGenerated; +import com.vaadin.data.util.BeanContainer; +import com.vaadin.event.ShortcutAction.KeyCode; +import com.vaadin.server.ClassResource; +import com.vaadin.server.Resource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.AbsoluteLayout; +import com.vaadin.ui.Alignment; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.CustomComponent; +import com.vaadin.ui.Embedded; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Notification; +import com.vaadin.ui.Table; +import com.vaadin.ui.Table.ColumnGenerator; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; + +/** + * This test cannot be automated. http://dev.vaadin.com/ticket/6160, base code + * by user radosdesign. + * + * The test fails if even occasionally empty rows appear in the table. A + * relatively good way to get them (before the fix) is to wait for the page to + * load, move the scrollbar down, press 'R' before the rows have time to be + * rendered, and then move the scrollbar up when no rows have been rendered yet. + * After this, when you scroll down slowly there may be empty rows. This doesn't + * happen always, and you may need to force the threads slower to get it to + * happen at all. On a slow 32-bit Windows 7 with Chrome version 22.0.1229.94 m + * (no GWT dev mode) this test has managed to reproduce the problem maybe nine + * times out of ten. + * + * @author Anna Koskinen / Vaadin Oy + * + */ +public class EmptyRowsWhenScrolling extends UI { + + @Override + public void init(VaadinRequest request) { + getPage().setTitle("Simpletable Application"); + AppView appView = new AppView(this); + setContent(appView); + addAction(new Button.ClickShortcut(appView.getBtnRefreshTable(), + KeyCode.R)); + } + + private class AppView extends CustomComponent { + + @AutoGenerated + private AbsoluteLayout mainLayout; + @AutoGenerated + private VerticalLayout verticalLayout_1; + @AutoGenerated + private Table table; + @AutoGenerated + private HorizontalLayout horizontalLayout_1; + @AutoGenerated + private Button btnRefreshTable; + + /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ + + /*- VaadinEditorProperties={"grid":"RegularGrid,20","showGrid":true,"snapToGrid":true,"snapToObject":true,"movingGuides":false,"snappingDistance":10} */ + + /** + * The constructor should first build the main layout, set the + * composition root and then do any custom initialization. + * + * The constructor will not be automatically regenerated by the visual + * editor. + */ + public AppView(final UI application) { + buildMainLayout(); + setCompositionRoot(mainLayout); + + // Container with sample data + BeanContainer<Integer, SimpleBean> container = new BeanContainer<Integer, SimpleBean>( + SimpleBean.class); + container.setBeanIdProperty("id"); + for (int i = 1; i <= 50; ++i) { + container.addBean(new SimpleBean(i, "image", + "Column1 row " + i, "Column2 row " + i, "Column3 row " + + i, "Column4 row " + i)); + } + table.setContainerDataSource(container); + table.setEditable(true); + table.setColumnReorderingAllowed(true); + table.setVisibleColumns(new String[] { "image", "id", "col1", + "col2", "col3", "col4" }); + table.addGeneratedColumn("image", new ColumnGenerator() { + public Object generateCell(Table source, Object itemId, + Object columnId) { + int imgNum = new Random().nextInt(5) + 1; + try { + // Simulate background work + System.out + .println("Generated column for image /com/example/simpletable/img/px50-" + + imgNum + ".jpg"); + Thread.sleep(50); + } catch (InterruptedException e) { + e.printStackTrace(); + } + Resource resource = new ClassResource( + "/com/example/simpletable/img/px50-" + imgNum + + ".jpg"); + Embedded image = new Embedded("", resource); + image.setWidth("50px"); + image.setHeight("50px"); + image.addClickListener(new com.vaadin.event.MouseEvents.ClickListener() { + public void click( + com.vaadin.event.MouseEvents.ClickEvent event) { + Notification.show("Image clicked!"); + } + }); + return image; + } + }); + + // Refresh table button + getBtnRefreshTable().addClickListener(new ClickListener() { + public void buttonClick(ClickEvent event) { + table.refreshRowCache(); + } + }); + } + + @AutoGenerated + private AbsoluteLayout buildMainLayout() { + // common part: create layout + mainLayout = new AbsoluteLayout(); + mainLayout.setImmediate(false); + mainLayout.setWidth("100%"); + mainLayout.setHeight("100%"); + + // top-level component properties + setWidth("100.0%"); + setHeight("100.0%"); + + // verticalLayout_1 + verticalLayout_1 = buildVerticalLayout_1(); + mainLayout.addComponent(verticalLayout_1, "top:0.0px;left:0.0px;"); + + return mainLayout; + } + + @AutoGenerated + private VerticalLayout buildVerticalLayout_1() { + // common part: create layout + verticalLayout_1 = new VerticalLayout(); + verticalLayout_1.setImmediate(false); + verticalLayout_1.setWidth("100.0%"); + verticalLayout_1.setHeight("100.0%"); + verticalLayout_1.setMargin(false); + + // horizontalLayout_1 + horizontalLayout_1 = buildHorizontalLayout_1(); + verticalLayout_1.addComponent(horizontalLayout_1); + + // table_1 + table = new Table(); + table.setImmediate(false); + table.setWidth("100.0%"); + table.setHeight("100.0%"); + verticalLayout_1.addComponent(table); + verticalLayout_1.setExpandRatio(table, 1.0f); + + return verticalLayout_1; + } + + @AutoGenerated + private HorizontalLayout buildHorizontalLayout_1() { + // common part: create layout + horizontalLayout_1 = new HorizontalLayout(); + horizontalLayout_1.setImmediate(false); + horizontalLayout_1.setWidth("100.0%"); + horizontalLayout_1.setHeight("-1px"); + horizontalLayout_1.setMargin(false); + + // btnRefreshTable + setBtnRefreshTable(new Button()); + getBtnRefreshTable().setCaption("Reload table row cache"); + getBtnRefreshTable().setImmediate(false); + getBtnRefreshTable().setWidth("-1px"); + getBtnRefreshTable().setHeight("-1px"); + horizontalLayout_1.addComponent(getBtnRefreshTable()); + horizontalLayout_1.setComponentAlignment(getBtnRefreshTable(), + new Alignment(33)); + + return horizontalLayout_1; + } + + public Button getBtnRefreshTable() { + return btnRefreshTable; + } + + public void setBtnRefreshTable(Button btnRefreshTable) { + this.btnRefreshTable = btnRefreshTable; + } + + } + + protected class SimpleBean { + private int id; + private String image; + private String col1; + private String col2; + private String col3; + private String col4; + + public SimpleBean(int id, String image, String col1, String col2, + String col3, String col4) { + super(); + this.id = id; + this.image = image; + this.col1 = col1; + this.col2 = col2; + this.col3 = col3; + this.col4 = col4; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getCol1() { + return col1; + } + + public void setCol1(String col1) { + this.col1 = col1; + } + + public String getCol2() { + return col2; + } + + public void setCol2(String col2) { + this.col2 = col2; + } + + public String getCol3() { + return col3; + } + + public void setCol3(String col3) { + this.col3 = col3; + } + + public String getCol4() { + return col4; + } + + public void setCol4(String col4) { + this.col4 = col4; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + } + +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/EmptyingTreeTableTest.html b/uitest/src/com/vaadin/tests/components/treetable/EmptyingTreeTableTest.html new file mode 100644 index 0000000000..0c43d41aca --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/treetable/EmptyingTreeTableTest.html @@ -0,0 +1,52 @@ +<?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="http://localhost:8888/run/com.vaadin.tests.components.treetable.TreeTableTest?restartApplication" /> +<title>EmptyingTreeTableTest</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">EmptyingTreeTableTest</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.treetable.TreeTableTest?restartApplication</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>initial</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::PID_Smenu#item0</td> + <td>46,6</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[0]/VMenuBar[0]#item5</td> + <td>12,7</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[1]/VMenuBar[0]#item1</td> + <td>84,9</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableTest::Root/VOverlay[2]/VMenuBar[0]#item0</td> + <td>16,10</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>itemsRemoved</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdate.html b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdate.html index d9366385ce..df1656dd23 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdate.html +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdate.html @@ -4,12 +4,12 @@ <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>New Test</title> +<title>TreeTableCacheOnPartialUpdates</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> +<tr><td rowspan="1" colspan="3">TreeTableCacheOnPartialUpdates</td></tr> </thead><tbody> <tr> <td>open</td> @@ -18,17 +18,17 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VNativeButton[0]</td> + <td>cacheTestButton-1 (children)-A</td> <td>47,5</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VNativeButton[0]</td> + <td>cacheTestButton-2-B</td> <td>46,7</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[6]/VNativeButton[0]</td> + <td>cacheTestButton-7 (children)-G</td> <td>54,12</td> </tr> <tr> @@ -48,7 +48,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>cacheTestButtonToggle-1 (children)-A</td> <td>10,7</td> </tr> <tr> @@ -58,27 +58,27 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VNativeButton[0]</td> + <td>cacheTestButton-1 (children)-A</td> <td>81,6</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VNativeButton[0]</td> + <td>cacheTestButton-1.1-A.A</td> <td>73,8</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VNativeButton[0]</td> + <td>cacheTestButton-1 (children)-A</td> <td>86,7</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[5]/VNativeButton[0]</td> + <td>cacheTestButton-1.5-A.E</td> <td>72,2</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[6]/VNativeButton[0]</td> + <td>cacheTestButton-2-B</td> <td>73,7</td> </tr> <tr> @@ -108,7 +108,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>cacheTestButtonToggle-1 (children)-A</td> <td>11,2</td> </tr> <tr> @@ -118,22 +118,22 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VNativeButton[0]</td> + <td>cacheTestButton-1 (children)-A</td> <td>76,5</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[2]/VNativeButton[0]</td> + <td>cacheTestButton-3 (children)-C</td> <td>58,7</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[1]/VNativeButton[0]</td> + <td>cacheTestButton-2-B</td> <td>69,10</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[0]/VNativeButton[0]</td> + <td>cacheTestButton-1 (children)-A</td> <td>78,7</td> </tr> <tr> @@ -173,22 +173,22 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[41]/VNativeButton[0]</td> + <td>cacheTestButton-100-CV</td> <td>53,-2462</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[34]/VNativeButton[0]</td> + <td>cacheTestButton-93-CO</td> <td>91,-2452</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[28]/VNativeButton[0]</td> + <td>cacheTestButton-87-CI</td> <td>84,-2461</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[41]/VNativeButton[0]</td> + <td>cacheTestButton-100-CV</td> <td>102,-2452</td> </tr> <tr> @@ -234,7 +234,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[34]/domChild[0]/domChild[0]/domChild[0]</td> + <td>cacheTestButtonToggle-40 (children)-AN</td> <td>9,-995</td> </tr> <tr> @@ -249,7 +249,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[34]/VNativeButton[0]</td> + <td>cacheTestButton-40 (children)-AN</td> <td>93,-991</td> </tr> <tr> @@ -259,7 +259,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[35]/VNativeButton[0]</td> + <td>cacheTestButton-40.1-AN.A</td> <td>123,-991</td> </tr> <tr> @@ -269,7 +269,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[40]/VNativeButton[0]</td> + <td>cacheTestButton-40.6-AN.F</td> <td>114,-1000</td> </tr> <tr> @@ -279,7 +279,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[34]/VNativeButton[0]</td> + <td>cacheTestButton-40 (children)-AN</td> <td>118,-993</td> </tr> <tr> @@ -289,7 +289,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[34]/domChild[0]/domChild[0]/domChild[0]</td> + <td>cacheTestButtonToggle-40 (children)-AN</td> <td>9,-998</td> </tr> <tr> @@ -304,7 +304,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[34]/VNativeButton[0]</td> + <td>cacheTestButton-40 (children)-AN</td> <td>42,-990</td> </tr> <tr> @@ -314,7 +314,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[29]/VNativeButton[0]</td> + <td>cacheTestButton-35-AI</td> <td>84,-990</td> </tr> <tr> @@ -324,12 +324,12 @@ </tr> <tr> <td>waitForElementPresent</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[42]/VNativeButton[0]</td> + <td>cacheTestButton-48-AV</td> <td></td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[42]/VNativeButton[0]</td> + <td>cacheTestButton-48-AV</td> <td>98,-998</td> </tr> <tr> @@ -339,7 +339,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[35]/VNativeButton[0]</td> + <td>cacheTestButton-41-AO</td> <td>101,-994</td> </tr> <tr> @@ -359,22 +359,22 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[30]/VNativeButton[0]</td> + <td>cacheTestButton-86-CH</td> <td>136,-2447</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[42]/VNativeButton[0]</td> + <td>cacheTestButton-98-CT</td> <td>131,-2462</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[43]/VNativeButton[0]</td> + <td>cacheTestButton-99 (children)-CU</td> <td>134,-2459</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[44]/VNativeButton[0]</td> + <td>cacheTestButton-100-CV</td> <td>144,-2454</td> </tr> <tr> @@ -399,17 +399,17 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[43]/domChild[0]/domChild[0]/domChild[0]</td> + <td>cacheTestButtonToggle-99 (children)-CU</td> <td>10,-2461</td> </tr> <tr> <td>waitForElementPresent</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[43]/VNativeButton[0]</td> + <td>cacheTestButton-99 (children)-CU</td> <td></td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[43]/VNativeButton[0]</td> + <td>cacheTestButton-99 (children)-CU</td> <td>65,-2456</td> </tr> <tr> @@ -424,7 +424,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[30]/VNativeButton[0]</td> + <td>cacheTestButton-86-CH</td> <td>109,-2455</td> </tr> <tr> @@ -434,7 +434,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[44]/VNativeButton[0]</td> + <td>cacheTestButton-99.1-CU.A</td> <td>82,-2457</td> </tr> <tr> @@ -454,22 +454,22 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[43]/VNativeButton[0]</td> + <td>cacheTestButton-99 (children)-CU</td> <td>85,-2792</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[42]/VNativeButton[0]</td> + <td>cacheTestButton-98-CT</td> <td>101,-2788</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[44]/VNativeButton[0]</td> + <td>cacheTestButton-99.1-CU.A</td> <td>111,-2794</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[56]/VNativeButton[0]</td> + <td>cacheTestButton-99.13-CU.M</td> <td>113,-2794</td> </tr> <tr> @@ -495,7 +495,7 @@ <!--collapse 99--> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[43]/domChild[0]/domChild[0]/domChild[0]</td> + <td>cacheTestButtonToggle-99 (children)-CU</td> <td>11,-2792</td> </tr> <tr> @@ -505,12 +505,12 @@ </tr> <tr> <td>waitForElementPresent</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[40]/VNativeButton[0]</td> + <td>cacheTestButton-99 (children)-CU</td> <td></td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[40]/VNativeButton[0]</td> + <td>cacheTestButton-99 (children)-CU</td> <td>71,-2465</td> </tr> <tr> @@ -520,7 +520,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[41]/VNativeButton[0]</td> + <td>cacheTestButton-100-CV</td> <td>81,-2459</td> </tr> <tr> @@ -530,7 +530,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[39]/VNativeButton[0]</td> + <td>cacheTestButton-98-CT</td> <td>80,-2458</td> </tr> <tr> @@ -540,7 +540,7 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstreetableTreeTableCacheOnPartialUpdates::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[3]/VTreeTable[0]/FocusableScrollPanel[0]/VTreeTable$VTreeTableScrollBody[0]/VTreeTable$VTreeTableScrollBody$VTreeTableRow[28]/VNativeButton[0]</td> + <td>cacheTestButton-87-CI</td> <td>86,-2462</td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java index c2bd3da860..f792a32f8f 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java @@ -72,13 +72,11 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { public Component generateCell(final com.vaadin.ui.Table source, final Object itemId, Object columnId) { TestBean tb = (TestBean) itemId; - // if (!tb.getCol1().contains("children")) { - // return null; - // } String identifier = "Item " + itemId + "/" + columnId; - System.out.println("Generating new Button for " + identifier); Button btnCol3 = new NativeButton(identifier); - btnCol3.addListener(new Button.ClickListener() { + btnCol3.setId("cacheTestButton-" + tb.getCol1() + "-" + + tb.getCol2()); + btnCol3.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { log.log("Button " + event.getButton().getCaption() @@ -91,6 +89,25 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { } + public class Col4ColumnGenerator implements ColumnGenerator { + public Component generateCell(final com.vaadin.ui.Table source, + final Object itemId, Object columnId) { + TestBean tb = (TestBean) itemId; + String identifier = "Expand/Collapse"; + Button btnCol4 = new NativeButton(identifier); + btnCol4.setId("cacheTestButtonToggle-" + tb.getCol1() + "-" + + tb.getCol2()); + btnCol4.addClickListener(new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + treeTable.setCollapsed(itemId, + !treeTable.isCollapsed(itemId)); + } + }); + return btnCol4; + } + + } + protected int indexOfId(Table source, Object itemId) { Container.Ordered c = (Ordered) source.getContainerDataSource(); if (c instanceof Container.Indexed) { @@ -105,19 +122,17 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { private TreeTable treeTable; private BeanItemContainer<TestBean> testBeanContainer; private static String[] columnHeaders = new String[] { "Col1", "Col2", - "Col3" }; + "Col3", "Col4" }; private static Object[] visibleColumns = new Object[] { "col1", "col2", - "col3" }; + "col3", "col4" }; @Override public void setup() { - setTheme("reindeer-tests"); - // Force row height to be the same in all browsers so scrolling based on // pixels works as expected Button b = new Button("Show first"); addComponent(b); - b.addListener(new ClickListener() { + b.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { @@ -132,7 +147,7 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { cacheRateSelect.addItem(new Integer(1)); cacheRateSelect.addItem(new Integer(2)); cacheRateSelect.setValue(2); - cacheRateSelect.addListener(new ValueChangeListener() { + cacheRateSelect.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { @@ -143,7 +158,6 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { addComponent(cacheRateSelect); treeTable = new TreeTable(); treeTable.addStyleName("table-equal-rowheight"); - // treeTable.setPageLength(0); testBeanContainer = new BeanItemContainer<TestBean>(TestBean.class); Map<String, Integer> hasChildren = new HashMap<String, Integer>(); @@ -156,7 +170,8 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { hasChildren.put("99", 20); treeTable.setContainerDataSource(createContainer(100, hasChildren)); treeTable.addGeneratedColumn("col3", new Col3ColumnGenerator()); - treeTable.addListener(new ExpandListener() { + treeTable.addGeneratedColumn("col4", new Col4ColumnGenerator()); + treeTable.addExpandListener(new ExpandListener() { @Override public void nodeExpand(ExpandEvent event) { @@ -164,7 +179,7 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { } }); - treeTable.addListener(new CollapseListener() { + treeTable.addCollapseListener(new CollapseListener() { @Override public void nodeCollapse(CollapseEvent event) { @@ -172,12 +187,11 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { } }); - treeTable.setColumnHeaders(columnHeaders); treeTable.setVisibleColumns(visibleColumns); + treeTable.setColumnHeaders(columnHeaders); treeTable.setColumnWidth("col1", 150); treeTable.setColumnWidth("col2", 50); treeTable.setHeight("430px"); - // treeTable.setColumnWidth("col3", 150); addComponent(log); addComponent(treeTable); } diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.html b/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.html new file mode 100644 index 0000000000..1aa952d77e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.html @@ -0,0 +1,61 @@ +<?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>TreeTableInternalError</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">TreeTableInternalError</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/com.vaadin.tests.components.treetable.TreeTableInternalError?restartApplication</td> + <td></td> +</tr> +<tr> + <td>scroll</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableInternalError::PID_Streetable/domChild[1]</td> + <td>1320</td> +</tr> +<tr> + <td>waitForElementPresent</td> + <td>cacheTestButtonToggle-57</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>resize</td> + <td></td> +</tr> +<tr> + <td>scroll</td> + <td>vaadin=runcomvaadintestscomponentstreetableTreeTableInternalError::PID_Streetable/domChild[1]</td> + <td>1500</td> +</tr> +<tr> + <td>waitForElementPresent</td> + <td>cacheTestButtonToggle-55</td> + <td></td> +</tr> +<tr> + <td>mouseClick</td> + <td>cacheTestButtonToggle-55</td> + <td>-402,-1632</td> +</tr> +<tr> + <td>mouseClick</td> + <td>cacheTestButtonToggle-58</td> + <td>-402,-1660</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td></td> +</tr> +</tbody></table> +</body> +</html> diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.java new file mode 100644 index 0000000000..f6d7f11eb7 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableInternalError.java @@ -0,0 +1,82 @@ +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.Component; +import com.vaadin.ui.NativeButton; +import com.vaadin.ui.Table.ColumnGenerator; +import com.vaadin.ui.TreeTable; +import com.vaadin.ui.VerticalLayout; + +public class TreeTableInternalError extends TestBase { + private TreeTable t; + + @Override + protected void setup() { + VerticalLayout content = getLayout(); + content.setSizeFull(); + + t = new TreeTable() { + { + setSizeFull(); + fillTreeTable(this); + } + }; + t.setId("treetable"); + content.addComponent(t); + content.setExpandRatio(t, 1); + + Button button = new Button("Resize") { + { + addClickListener(new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + t.setHeight("300px"); + } + }); + } + }; + button.setId("resize"); + content.addComponent(button); + } + + @Override + protected String getDescription() { + return "Internal Error when scrolling down enough that more rows are loaded (cache updated), then scrolling down just a few rows and expanding rows"; + } + + @Override + protected Integer getTicketNumber() { + return 10057; + } + + private void fillTreeTable(TreeTable t) { + t.addContainerProperty("name", String.class, null); + t.addGeneratedColumn("toggle", new ButtonColumnGenerator()); + for (int i = 0; i < 1000; i++) { + t.addItem(i); + t.getContainerProperty(i, "name").setValue("Item-" + i); + t.addItem(i + "c"); + t.getContainerProperty(i + "c", "name").setValue("Child-" + i); + t.setParent(i + "c", i); + t.setChildrenAllowed(i + "c", false); + } + } + + public class ButtonColumnGenerator implements ColumnGenerator { + public Component generateCell(final com.vaadin.ui.Table source, + final Object itemId, Object columnId) { + String identifier = "Expand/Collapse"; + Button btnCol = new NativeButton(identifier); + btnCol.setId("cacheTestButtonToggle-" + itemId); + btnCol.addClickListener(new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + t.setCollapsed(itemId, !t.isCollapsed(itemId)); + } + }); + return btnCol; + } + + } + +} |