12-09-2010 05:10 PM
I have a list that gets set with a new DataProvider with an Array:
this._list.dataProvider = null; this._list.dataProvider = new DataProvider( data ); this._list.selectedIndex = (-1);
Everything is OK.
When this function gets called again, the information in list seems to get screwed up some. I've inspected the this._list.dataProvider.data and the information looks good. I have a custom renderer for the list, but I assume that if the dataProvider is cleared, the items defining the renderer would be cleared too. The renderer extends AlternatingCellRenderer and only overrides drawLabel to properly position and set the values of the additional labels.
I override onRemoved and call removeChild on the additional resources.
I event tried only adding the additonal resources with onAdded, but the results are still the same; residual items from another part of the list gets sset elsewhere.
Any thoughts that I should investigate?
12-09-2010 05:15 PM
the residual data, is it coming from the cellrenderer? try resetting the cellrenderer before you add the new dataprovider and than reapplying the cellrenderer to the list with the new data.
12-09-2010 06:36 PM
The pattern seems to be if the label in the renderer is left blank, the second (or third, ...) time it is used, picks up a label from another item in the list (always the last item in the list). The first item in the list has a blank label. If I default the label to (space) ' ', instead of blank, it seems to be fine.
@jrab: I hope you're working on your own projects. You've been a big help to this forum!
12-09-2010 06:47 PM
haha thanks for your concern much appreciated yes i am working on my own stuff but whenever i run into a snag i come into here and help out and somehow it sparks a new random thought and helps me figure out what im gonna do next with my project. you could say its theraputic hah.
and as for the residual data, im trying to replicate the problem but cant seem to. your list might be a little more involved than the example im using here. ill keep looking into it and if i can come up with anything ill let you know . good luck!