Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

List for refresh of renderers

Well, this was one of those "features" of the QNX controls that knock you head against the wall for a couple of days and then a workaround seems to "fix" the issue.


If you are using the QNX List control with a custom renderer and you need to update an item in the list and the QNX DataProvider methods of updateItemAt or replaceItemAt does not seem to refresh the item, then the quick "fix" is to resize the list by a pixel and that will refresh all the items displayed.  I dont have do tdo this if the items in the data provider are normal Objects, but if you are adding your own class to the data provider, it seems to not want to update when using replaceItemAt (or updateItemAt).  It will show fine initially, but not on updates.


So, the work around is on a refresh is:


this.mylist.width -= 1;

this.mylist.width += 1;


I extended the class and just added my own invalidateList method with this in it.


Also, if you have your own class in an Array, and you just update your object in that array, you dont have to use updateItemAt or replaceItemAt, you just have to resize the list as described above to refresh everything since the data of the list is still referencing your objects in memory.


Hope this helps someome in the future.

Please use plain text.