List selectedItem issue + dataprovider update
I use a list which is filled with objects in flex3. I get my objects from mysql/php.
I have got a timer to refresh my list, in case a new client was added somewhere. To do this I get all my clients from the database again and put them in the list. In this case my selectedItem gets lost aswell as the scrollposition. Scrollposition was easy to fix, with the 'verticalScrollPosition' property. I want to do the same with the selectedItem, but this doesn't work. On the change event I keep my selectedItem in a new object, which I try to set again in the resulthandler of my getClient function.
I get every time that there's a term undefined and without properties, which is about my list.selectedItem. My variable in which I keep my object traces as an object, so this cannot be the problem.
How can I solve this? Also, is there an easier way to update my list?