开发者

How to clear the existing list data values

开发者 https://www.devze.com 2022-12-20 05:25 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消