views:

39

answers:

2

I would like to know how to delete(clear) the existing list data values before binding new values.

I'm using the list for 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?

A: 

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.

Amarghosh
thank's i'll try
maniohile
A: 

You can explicitly set the dataProvider to null, or you can use removeAll() on the dataProvider.

Sai Prasad