07-24-2012 07:53 AM
As you have noted, the code supplied does not match your specifications in that there is no scrollChangeListener involved.
But the code supplied by pp demonstrates an alternative approach. In it, you keep tabs on the currently in focus Cell, and then set the scroll positions appropriately. So you are actually moving the Cells rather than reacting to the user moving the cells.
You say that the scroll change listener 'lags' which is the problem you have with my option (c). Can you give us a quick summary of your test environment (OS, number of cells etc). I will try to find out if I can get it working quicker. As noted, it is something I have always wondered about, I might have a go to see if I can figure out what I would actually do!
07-24-2012 08:58 AM
07-25-2012 01:31 AM
Well Peter, i have around 9 columns and around 200 rows. Iam using the Blackberry Eclipse plugin. The OS is BB6.0.
Iam not sure you got what i meant about the scroll delay. So, il explain again.
Its like if you set the scroll manually of the table with fixed columns the same as the scroll of table with data in the scroll change listener of table with data, then the scroll of the table with fixed columns lags the scroll of the table with data.
07-25-2012 06:52 AM
Thank you for the help Peter and pp. I found the solution. Instead of setting the scroll of the table with fixed row/col in the onScrollChange of table with data, i had to do it in the paint of the table with data. It still results in a very very small lag. But it is not visible for small movements.
07-25-2012 07:11 AM
I am a little worried about doing this, because you are effectively updating a Ui component while updating another Ui component and the order in which things happen will be set by the framework and not by you. So at some stage RIM might break your code by doing things in a different order. So I suggest that you test this over the range of OS's you intend to support.
In addition, I would recommend that you keep a track of the last position you set and only do the setScroll when it changes so you minimize the overhead.
That said, it is an interesting idea and I applaud your efforts trying to find a solution for yourself. Well done!