Unless the data object is [bindable], modifications to data objects must be accompanied by a call to itemUpdated on the collection.
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey Sent: Tuesday, November 13, 2007 8:40 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Item Renderer Not Updating I know there's got to be something simple that I'm overlooking, and I thought that I read something pertaining to this in the docs, but for the life of me I can't find it. Thanks for any suggestions, Geoff --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Geoffrey" <[EMAIL PROTECTED]> wrote: > > 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 >