From: Artur Signell Date: Fri, 4 Nov 2011 08:13:49 +0000 (+0000) Subject: #7839 Avoid discarding rows when updating rows as row indexes have not been updated... X-Git-Tag: 7.0.0.alpha1~225^2~31 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=35877d090e082346758235ff16341525f6f42aec;p=vaadin-framework.git #7839 Avoid discarding rows when updating rows as row indexes have not been updated yet causing wrong rows to be removed svn changeset:21894/svn branch:6.7 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index 1588936c3c..959b92cffa 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -1431,8 +1431,6 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, int count = partialRowUpdates.getIntAttribute("numurows"); scrollBody.unlinkRows(firstRowIx, count); scrollBody.insertRows(partialRowUpdates, firstRowIx, count); - - discardRowsOutsideCacheWindow(); } /** @@ -1460,14 +1458,18 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, + scrollBody.getLastRendered() + " rendered!"); } } - discardCacheRows(firstRowToKeep, lastRowToKeep); + discardRowsOutsideOf(firstRowToKeep, lastRowToKeep); scrollBody.fixSpacers(); scrollBody.restoreRowVisibility(); } - private void discardCacheRows(int optimalFirstRow, int optimalLastRow) { + private void discardRowsOutsideOf(int optimalFirstRow, int optimalLastRow) { + /* + * firstDiscarded and lastDiscarded are only calculated for debug + * purposes + */ int firstDiscarded = -1, lastDiscarded = -1; boolean cont = true; while (cont && scrollBody.getLastRendered() > optimalFirstRow