How to clear the existing list data values
I would like to know how to delete(clear) the existing list data values before binding new values.
I'm using the list 开发者_如何学JAVAfor binding data dynamically using http services. When I make a new call to the service, I want the exiting items to be flushed and bind the newly retrieved data to the same list. How can I achieve this?
You can explicitly set the dataProvider to null, or you can use removeAll() on the dataProvider.
You need not clear the data if you are binding httpService.lastResult
to list.dataProvider
. The data binding will create a new ListCollectionView
object (ArrayCollection
or XMLListCollection
as the case may be) and assign it to list.dataProvider
. Old data will be cleared automatically.
精彩评论