maniohile
maniohile

Reputation: 43

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 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?

Upvotes: 1

Views: 736

Answers (2)

Sai Prasad
Sai Prasad

Reputation: 735

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

Upvotes: 2

Amarghosh
Amarghosh

Reputation: 59461

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.

Upvotes: 0

Related Questions