I have a List that is bound to an ArrayCollection.  If I programaticly
update the ArrayCollection, the itemRenderer fails to update as well.

<mx:List id="userList"
    dataProvider="{__resourceModel.userSummaries}"
    selectable="false"
    itemClick="onItemClick(event)"
    itemRenderer="mx.controls.CheckBox"
    width="100%" height="100%"/>


__resourceModel.userSummaries is an ArrayCollection of
ResourceItemModels which looks like:
public class ResourceItemModel implements ModelLocator
{
    public var username:String;
    public var firstName:String;
    public var lastName:String;
    // These are used by an itemRenderer
    public var label:String;
    public var selected:Boolean;
    ....
}


The List is a list of CheckBoxes with the username as the label.  When
someone selects one of the CheckBoxes, it go off and sets the
'selected' property of the specific ResourceItemModel to true.  This
part works just fine.

After a certain user gesture, I want to set all selections back to
false, then reselect any CheckBox selections that may have existed. 
This information comes from another model.  The resetting of the
CheckBoxes is in a loop that does:
    ResourceItemModel(userSummaries[i]).selected = false;

This properly sets the models selected property to false, but the view
does not update (ie. the CheckBox is still selected).


How do I update the itemRender after I programmaticly update the
dataProvider?

Thanks,
Geoff


Reply via email to