12-12-2010 08:36 AM - edited 12-12-2010 08:37 AM
what is the difference between replaceItem() and updateItem() or replaceItemAt() and updateItemAt() methods of the qnx.ui.data.DataProvider class?
Solved! Go to Solution.
12-12-2010 09:20 AM - edited 12-12-2010 09:43 AM
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!