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

Bug 197008

Summary: Missing notifications with sychronized scrolling of 2 grids (one without scrollbar)
Product: z_Archived Reporter: David Császár <csaszar>
Component: NebulaAssignee: Chris Gross <cgross>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: tom.schindl
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
snippet demonstrating the bug
none
new example none

Description David Császár CLA 2007-07-18 14:45:29 EDT
Build ID: I20070621-1340

Steps To Reproduce:
1. we have 2 grids, where a slave grid is connected to the master via setlVerticalScrollBarProxy
2. scroll sync is fine via the scrollbars
3. when scrolling the master by traversing a column with cursor keys the slave is not sychronized (no events fire)
4. when traversing the slave the master's scrollbar is updated, but not the master's content (getTopIndex doesn't change)


More information:
Comment 1 Chris Gross CLA 2007-08-20 15:11:07 EDT
Hi David,

Can you attach a snippet of what you're trying to do.  The scrollbar proxies weren't meant for this use case but may work.  The lack of a horz proxy may account for 3.  

-Chris
Comment 2 David Császár CLA 2007-08-21 00:12:04 EDT
Created attachment 76507 [details]
snippet demonstrating the bug

my current workaround is included, just uncomment and re-run
Comment 3 Chris Gross CLA 2007-08-21 11:06:42 EDT
Created attachment 76544 [details]
new example

David - here is a different technique to accomplish the synchronized scrolling.  The scrollbar proxies shouldn't really be used for this kind of thing.  Let me know if this example works for you.
Comment 4 David Császár CLA 2007-08-21 12:16:35 EDT
it doesn't work for me.
in my case the left grid doesn't have scrollbars at all (SWT.NONE).
so i'm not able to attach scroll event handlers to this grid.
Comment 5 Chris Gross CLA 2007-08-21 13:43:48 EDT
Then you can just remove the scrollbar listener for that grid.  The remaining code should work.  
Comment 6 David Császár CLA 2007-08-21 13:57:16 EDT
it doesn't.
obviously the line
grid1.setTopIndex(grid2.getTopIndex());
has no effect if grid1 has no scrollbar.

grid1 (without bar) also doesn't scroll when the grid cursor reaches the bottom.
Comment 7 Chris Gross CLA 2007-08-21 14:30:48 EDT
Oh.. right.  I didn't think about that.  Then the code you have seems fine.  The scrollbar proxies aren't intended for things like this but it seems to work ok.  I would change your workaround to use selection listeners rather than traverse listeners but otherwise it seems ok.  

Are there more issues or were you just asking for an easier way to support this?
Comment 8 David Császár CLA 2007-08-21 18:19:16 EDT
an easy (standard, recommended) way would be nice.
in fact my 1st (naive, derived from some other snippet) try looked a lot like the one you suggested.

so maybe this is the root cause for this bug, and comment 0 just a symptom.

apart from this the workaround is completely achieving what i want.
Comment 9 Chris Gross CLA 2007-08-22 14:44:41 EDT
Ok.  I'll leave this item open until there is an easier way to achieve this but for now your workaround is the only solution.
Comment 10 Thomas Schindl CLA 2009-04-24 08:43:57 EDT
Is the real feature you need the one in no #166089? I'll close this if you don't agree please reopen.

*** This bug has been marked as a duplicate of bug 166089 ***