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: 409
Registered: ‎12-10-2010
My Device: PlayBook
My Carrier: N/A
Accepted Solution

replaceItem vs. updateItem

[ Edited ]

what is the difference between replaceItem() and updateItem() or replaceItemAt() and updateItemAt() methods of the qnx.ui.data.DataProvider class?

PlayBook Applications:
Drop Swatch
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: replaceItem vs. updateItem

[ Edited ]

hey Darkin,


the two methods replaceItem() and updateItem() or replaceItemAt() and updateItemAt() methods using a perform the same tasks, respectively. The only difference is the event that these methods (are supposed to) dispatch from the dataprovider. When the replaceItem or replaceItemAt method is called the DataProviderEvent.REPLACE_ITEM is (supposed to be) dispatched. When the updatItem or updateItemAt method is called the DataProviderEvent.UPDATE_ITEM is (supposed to be) dispatched.


now when i say supposed to i mean they dont dispatch those events at the current moment. every time the dataprovider is changed in some way the only event that is dispatched is the DataProviderEvent.DATA_CHANGE event. Either they havent gotten around to utilizing the rest of the event types or they are just sticking with the one DATA_CHANGE event as an umbrella event i dont know.


so for now both methods do the same thing and even dispatch the same event. but theoretically they are supposed to dispatch two different types of events not the same one.


here's a list of the dataprovider's event list:




hope that helps! good luck!

J. Rab (Blog) (Twitter)
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman