Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 405473

Summary: [List] Doesn't retain the scroll position after a refresh, instead it scrolls to top
Product: [RT] RAP Reporter: Claudio Guglielmo <claudio.guglielmo>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 2.1   
Target Milestone: 2.1 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Snippet to reproduce the bug none

Description Claudio Guglielmo CLA 2013-04-11 10:17:56 EDT
Created attachment 229621 [details]
Snippet to reproduce the bug

When using a listviewer to refresh a list, the listviewer makes sure that the scroll position is the same as before the refresh (by restoring the topIndex), see AbstractListViewer#internalRefresh. This works well with Rap 1.5 and SWT, but with Rap 2.0 it doesn't work anymore. Instead it scrolls to the top.

Little investigation showed, that setTopIndex of the js-list is not called and the topIndex is always 0. See the attached snippet as example.
Comment 1 Ivan Furnadjiev CLA 2013-04-15 10:47:59 EDT
Could be related to this bug 395053 or maybe a duplicate.
Comment 2 Ivan Furnadjiev CLA 2013-04-16 05:54:42 EDT
As a result the client and server are out of sync - List#getTopIndex() return the correct (old) value but the client scrolls to the top (topIndex = 0).
Comment 3 Ivan Furnadjiev CLA 2013-04-16 06:39:53 EDT
Fixed in master with commit d990c73dcf66ed9e657cfc27b92aaeed90456cd2.