aboutsummaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@gmail.com>2017-08-09 14:28:17 +0300
committerGitHub <noreply@github.com>2017-08-09 14:28:17 +0300
commitee9f287917056c61537559286577b38a1a93f70f (patch)
treeba08b34bd64c188db1507fae0587da0268d0dd0a /uitest
parent0c993377de46dbe89909f1f1cab06d3851e90851 (diff)
downloadvaadin-framework-ee9f287917056c61537559286577b38a1a93f70f.tar.gz
vaadin-framework-ee9f287917056c61537559286577b38a1a93f70f.zip
Fix occasional empty rows in Table and TreeTable (#9800)
Picked from #9551 in 7.7 There's an intermittently happening issue with both Table and TreeTable, which results in row data disappearing. This change removes a method which is probably a vestigial one from over five years ago and other changes are handling the things the method used to perform. Currently the method removes rows deemed unnecessary from the row buffer. The problem is, those rows are visible to the user and removing causes row contents to be lost. Also included are manually runnable test cases which demonstrate that this removal actually prevents the issue from happening. Fixes #7964 Fixes #5030
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/table/ComponentsDisappearWhenScrolling.java40
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/treetable/TreeTableComponentsDisappearWhenScrolling.java47
2 files changed, 87 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/ComponentsDisappearWhenScrolling.java b/uitest/src/main/java/com/vaadin/tests/components/table/ComponentsDisappearWhenScrolling.java
new file mode 100644
index 0000000000..3032e03f46
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/table/ComponentsDisappearWhenScrolling.java
@@ -0,0 +1,40 @@
+package com.vaadin.tests.components.table;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.shared.ui.ContentMode;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Label;
+import com.vaadin.v7.ui.Table;
+
+public class ComponentsDisappearWhenScrolling extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Label label = new Label(getDescription(), ContentMode.HTML);
+ addComponent(label);
+
+ Table table = new Table();
+ table.setSizeFull();
+ table.setCacheRate(1.1);
+ table.addContainerProperty(0, Button.class, null);
+ for (int i = 0; i < 100; i++) {
+ table.addItem(new Object[] { new Button() }, i);
+ }
+ addComponent(table);
+ }
+
+ @Override
+ public String getDescription() {
+ return "Scroll all the way down, then slowly back up. More often than"
+ + " not this results in 'flattening' of several rows. This is "
+ + "due to component connectors being unregistered on "
+ + "components, which are on visible table rows.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 7964;
+ }
+
+}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/treetable/TreeTableComponentsDisappearWhenScrolling.java b/uitest/src/main/java/com/vaadin/tests/components/treetable/TreeTableComponentsDisappearWhenScrolling.java
new file mode 100644
index 0000000000..f820d336af
--- /dev/null
+++ b/uitest/src/main/java/com/vaadin/tests/components/treetable/TreeTableComponentsDisappearWhenScrolling.java
@@ -0,0 +1,47 @@
+package com.vaadin.tests.components.treetable;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.shared.ui.ContentMode;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Label;
+import com.vaadin.v7.ui.TreeTable;
+
+public class TreeTableComponentsDisappearWhenScrolling extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Label label = new Label(getDescription(), ContentMode.HTML);
+ addComponent(label);
+
+ TreeTable table = new TreeTable();
+ table.setSizeFull();
+ table.setCacheRate(1.1);
+ table.addContainerProperty(0, Button.class, null);
+ for (int i = 0; i < 100; i++) {
+ table.addItem(new Object[] { new Button(Integer.toString(i)) }, i);
+ if ((i + 1) % 5 == 0) {
+ for (int j = 0; j < 4; j++) {
+ table.setParent(i - j, i - 4);
+ }
+ }
+ }
+
+ addComponent(table);
+ }
+
+ @Override
+ public String getDescription() {
+ return "Expand nodes and scroll all the way down, then slowly back up"
+ + ". More often than"
+ + " not this results in 'flattening' of several rows. This is "
+ + "due to component connectors being unregistered on "
+ + "components, which are on visible table rows.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 7964;
+ }
+
+}