From 007fc7e24385169eea52cb308c1cda24f0baa6fd Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Wed, 10 Oct 2007 11:16:27 +0000 Subject: [PATCH] avoiding timing issues with hosted mode svn changeset:2483/svn branch:trunk --- .../toolkit/terminal/gwt/client/ui/IScrollTable.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 -- 2.39.5