1 person found this helpful
Not understanding your question.
So, you just want to refresh any edited items?
You could create a data object (value object) and bind the properties to the itemRenderer lablels or controls.. and if any value changes.. then update the data object.
or.. if you want to update the whole arraycollection..
add an CollectionEvent and when CollectionEventKind == "refresh"... update the itemRenderers...
hope this helps,
I could create a demo app. but, i'm not sure exactly what you are looking for.
Thanks for your answer babo_ya!
I will try explain this again.
I have a Queue that contains Task-objects. The Task-object only know it's title and when to expire (Date).
My List will output the Title + the seconds until the Task expire.
Since I will have almost realtime-update, I would like to only refresh the visible items in the Listbox for a little performance-boost. The list might contain alot of items but only show about 10 rows at a time, is Flex smart enough to only update the visible ones?
My biggest problem is that im not fully aware how Bindable works. As far as i know I will have to create a getter/setter for the expire-time which i'd rather not. I got a timeLeft()-method that turns the expire date into seconds from now and returns it.
But im not sure how to trigger the onchange-event so that the List get's the updated objects.
If you are loading the whole data from the server at once then you should refresh the whole ArrayCollection. A better approach would be not to load the whole data from the server, instead limit the amount loaded to the number of enties you want to display. You could maybe just read the number of total elements and develop a paging system so that when the user clicks on "Page 3" then you'll load a specific limit from the server ( the data that is corresponding as position to "Page 3" ).
I'm a bit tired so sorry if I wasn't clear but I do hope you got the idea. So, don't load the whole data if you don't want to display it all at once. Instead, make more requests to the server and load in only the pieces that you actually want to display. This way, your refresh will be redurec to a simple call that will return a limited amount of data.
Otherwise, read the whole collection and update the entire list ( I'd do this because you might never know what other problems will arise on the way if you waste time segmenting you data on the client side somehow and then trying to figure out how to update only that segmented data with a server request ).