Bug 338686 - [TableViewer] Scrollbar request flooding
Summary: [TableViewer] Scrollbar request flooding
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 1.4 M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2011-03-02 10:33 EST by Oliver B. CLA
Modified: 2011-03-14 07:29 EDT (History)
3 users (show)

See Also:


Attachments
Snippet for reproduction (4.87 KB, text/x-java)
2011-03-03 10:50 EST, Oliver B. CLA
no flags Details
Controls Demo patch (1.20 KB, patch)
2011-03-04 11:04 EST, Ivan Furnadjiev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver B. CLA 2011-03-02 10:33:16 EST
The table viewer control can cause that an infinite number of requests will be send to the server. This will happen sometimes while scrolling in the table control. That behaviour is not visible to the user, but can be monitored with firebug. It seems to be browser indepedent (though only tested with Firefox/Google Chrome, because a network monitoring addon is needed). The requests contain information about the cursor location.

Steps to reproduce:

1. Start firebug for the open browser-tab
2. Set firebug to the network tab
3. Open the control demo site
4. Change to tab "TableViewer"
5. Add some more items ("Add 300 Items")
6. Resize the table to a proportion where scrolling vertical and horizontal is possible
7. Start scrolling via mouse wheel or scrollbar (either vertically or horizontally)
8. Watch firebug for a growing number of network requests and stop scrolling

If the requests don't stop after stopping to scroll, the bug was reproduced. It will not work always. Scrolling fastly can help to reproduce it.
Comment 1 Ivan Furnadjiev CLA 2011-03-03 05:38:16 EST
Oliver, I can't reproduce it with Controls Demo following your steps. Tested with FF 3.6.14 and Chrome 10.0.648.114 on Windows 7 with RAP from CVS HEAD.
Comment 2 Oliver B. CLA 2011-03-03 05:58:48 EST
Hm strange, I tested with Firefox 3.6.14 and Chrome 9.0.597.107 on Windows 7 (X64). I used the control demo war-file from http://rap.eclipsesource.com/rapdemo/examples (org.eclipse.rap.rwt_1.4.0.20110206-2301.jar) on a local tomcat server.
Comment 3 Tim Buschtoens CLA 2011-03-03 07:15:28 EST
(In reply to comment #2)

I cant reproduce it either. Can you also reproduce it with the Tree, List or ScrolledComposite? That would really help us narrow it down to a specific component.
Comment 4 Oliver B. CLA 2011-03-03 07:39:10 EST
(In reply to comment #3)
> I cant reproduce it either. Can you also reproduce it with the Tree, List or
> ScrolledComposite? That would really help us narrow it down to a specific
> component.

Now I tried it with the following controls:

- Tree (ok)
- Table (ok)
- List (ok)
- ScrolledComposite (ok)

- TableViewer (not ok)

It seems that these controls do not send requests to the server while scrolling. 
This seems to only occur with the TableViewer control.
Comment 5 Ivan Furnadjiev CLA 2011-03-03 07:55:35 EST
Oliver, do you have cell tooltips enabled on the TableViewer?  Could you try to disable them? Does it make any difference?
Comment 6 Oliver B. CLA 2011-03-03 08:21:04 EST
(In reply to comment #5)

I do not know how to change this in the control demo.
In my application there are no cell tooltips.
Comment 7 Tim Buschtoens CLA 2011-03-03 09:29:35 EST
Is your Table virtual?
Comment 8 Oliver B. CLA 2011-03-03 09:57:33 EST
(In reply to comment #7)
> Is your Table virtual?

No, it is a normal table viewer.
It has this styles:
SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI

ContentProvider: ObservableListContentProvider
LabelProvider: ObservableMapLabelProvider (+ ITableColorProvider / ITableFontProvider)
Input: Properties.selfList() (ArrayList)

Listeners:
SelectionListener

Layout:
TableColumnLayout (ColumnWeightData) with 12 columns.
Column sorting is enabled and a sort provider (ViewerComparator) is set.
Comment 9 Ivan Furnadjiev CLA 2011-03-03 10:12:16 EST
Oliver, as we can't reproduce it with the Controls Demo, could you provide a self running snippet with your TableViewer?
Comment 10 Oliver B. CLA 2011-03-03 10:50:01 EST
Created attachment 190277 [details]
Snippet for reproduction
Comment 11 Oliver B. CLA 2011-03-03 10:52:53 EST
(In reply to comment #9)
I made a simple snippet to reproduce the problem.
It is a standalone dialog with a tableviewer und some content/label provider.

I can reproduce the problem with this snippet.
Tested in my RWT-standalone application with RAP1.4M5.
Comment 12 Ivan Furnadjiev CLA 2011-03-04 10:05:03 EST
Thanks for the snippet, Oliver. With your snippet and using the horizontal scrollbar I can reproduce the issue.
Comment 13 Ivan Furnadjiev CLA 2011-03-04 10:40:10 EST
The problem is in ScrollBar.js - the _eventTimer is started, but never stopped. This leads to dispatching of changed event in a loop. The reason for this is ScrollBar.js#_getMergeCurrentEvent witch always returns true if the scroll step (diff) is big - this._lastDispatchedValue = 50, this._selection = 2000.
Comment 14 Ivan Furnadjiev CLA 2011-03-04 10:46:12 EST
The interesting part is that I can reproduce it now with Controls Demo -> TableViewer tab, but not with Table tab.
Comment 15 Oliver B. CLA 2011-03-04 10:53:37 EST
(In reply to comment #14)
I found that strange too. The normale table control without viewer seems to work differently. I could not reproduce it by any means.
Comment 16 Ivan Furnadjiev CLA 2011-03-04 11:04:43 EST
Created attachment 190403 [details]
Controls Demo patch

This is a Controls Demo -> TableTab patch to reproduce the issue. This patch adds a selection listener to the table horizontal scrollbar and makes the table columns 500px in width.
Steps to reproduce:
1. Start Controls Demo -> Table tab
2. Use horizontal scrollbar to scroll fast (with big step).
3. Observe the flooding.
Comment 17 Tim Buschtoens CLA 2011-03-09 11:54:02 EST
Fixed in CVS HEAD in ScrollBar.js. Please test it, but i cant reproduce it anymore with these changes.
Comment 18 Oliver B. CLA 2011-03-14 07:29:32 EDT
The patch seems to work fine. I cannot reproduce it anymore in my application.