From: Matti Tahvonen Date: Wed, 10 Oct 2007 11:16:27 +0000 (+0000) Subject: avoiding timing issues with hosted mode X-Git-Tag: 6.7.0.beta1~5871 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=007fc7e24385169eea52cb308c1cda24f0baa6fd;p=vaadin-framework.git avoiding timing issues with hosted mode svn changeset:2483/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java index 3d631ead51..5abbe6c095 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java @@ -413,6 +413,7 @@ public class IScrollTable extends Composite implements Table, ScrollListener, } protected void onDetach() { + rowRequestHandler.cancel(); super.onDetach(); // ensure that scrollPosElement will be detached if (scrollPositionElement != null) { @@ -549,7 +550,7 @@ public class IScrollTable extends Composite implements Table, ScrollListener, .setReqFirstRow(tBody.getLastRendered() + 1); rowRequestHandler .setReqRows((int) (pageLength * CACHE_RATE)); - rowRequestHandler.deferRowFetch(); + rowRequestHandler.deferRowFetch(0); } } }); @@ -689,9 +690,14 @@ public class IScrollTable extends Composite implements Table, ScrollListener, private int reqFirstRow = 0; private int reqRows = 0; + public void deferRowFetch() { + deferRowFetch(250); + } + + public void deferRowFetch(int msec) { if (reqRows > 0 && reqFirstRow < totalRows) { - schedule(250); + schedule(msec); // tell scroll position to user if currently "visible" rows are // not rendered