zia
zia

Reputation: 57

How to Auto Refresh <mx:List

I want to use event timer every 3 seconds to refresh List. I have created event timer but don't know about function to refresh List. has anyone ever did this?

I'll appreciate your help, thanks

Upvotes: 0

Views: 1199

Answers (1)

Rudy
Rudy

Reputation: 7044

You should bind the List to a datasource (arrayCollection). Whenever the arrayCollection being updated, it will refresh the list automatically, example

<mx:List dataProvider="{myAC}"/>

where myAC is arrayCollection that can be changed to another arrayCollection.

Code samples, check on this line ( "section Binding to arrays" )

Take note that it's better to bind instead of doing something like

list.datasource = anotherArrayCollection;

Upvotes: 2

Related Questions