From f7dc719ec5d9ba2c10362f4a175a9d764dc537bb Mon Sep 17 00:00:00 2001 From: Anthony Guerreiro Date: Tue, 15 Jul 2014 16:24:48 +0300 Subject: Fix Table stuck scroll position after setting scroll to last page (#14147) Change-Id: I9c39db5c2ccafd495a1ecc8b28687eeeebe3b6c2 --- client/src/com/vaadin/client/ui/VScrollTable.java | 6 +++++- client/src/com/vaadin/client/ui/table/TableConnector.java | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 5e6207f53f..ba90c0dfed 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -1185,7 +1185,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, @Override public void execute() { - if (firstvisible > 0) { + if (firstvisible >= 0) { firstRowInViewPort = firstvisible; if (firstvisibleOnLastPage > -1) { scrollBodyPanel @@ -7925,4 +7925,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, addCloseHandler.removeHandler(); } } + + public void totalRowsChanged() { + firstvisibleOnLastPage = -1; + } } diff --git a/client/src/com/vaadin/client/ui/table/TableConnector.java b/client/src/com/vaadin/client/ui/table/TableConnector.java index d37fd36522..04a2dfc3c4 100644 --- a/client/src/com/vaadin/client/ui/table/TableConnector.java +++ b/client/src/com/vaadin/client/ui/table/TableConnector.java @@ -146,6 +146,9 @@ public class TableConnector extends AbstractHasComponentsConnector implements getWidget().updatePageLength(uidl); getWidget().updateFirstVisibleAndScrollIfNeeded(uidl); + if (totalRowsChanged == true) { + getWidget().totalRowsChanged(); + } getWidget().showRowHeaders = uidl.getBooleanAttribute("rowheaders"); getWidget().showColHeaders = uidl.getBooleanAttribute("colheaders"); -- cgit v1.2.3