updateDisplayList is for updating all visuals including the text in labels. I think I would call itemRendererToIndex in updateDisplayList and modify the text at that time. Actually, I'd probably have a separate label just for the number and modify that.
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of williamkusumo Sent: Thursday, June 14, 2007 12:44 PM To: [email protected] Subject: [flexcoders] Re: Show incremental numeric index in a List Thanks for the feedback, guys! I implemented IDropInListItemRenderer and got ahold of listData.owner. You are right, itemRendererToIndex(...) will get you the correct index. The trouble now is how do I bind the result of itemRendererToIndex to a label inside the itemRenderer so that it automatically updates when the dataProvider is changed? You mentioned overriding updateDisplayList(), isn't that function related more to updating the styles? Thanks again! --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <[EMAIL PROTECTED]> wrote: > > You can implement IDropInListItemRenderer in your HBox if you want. > > > > You can also assume that "owner" is the List and call > itemRendererToIndex in an override of updateDisplayList(). > > > > ________________________________ > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of williamkusumo > Sent: Wednesday, June 13, 2007 5:53 PM > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Re: Show incremental numeric index in a List > > > > A quick note: The itemRenderer is based on HBox. So it does not > implement IDropInListItemRenderer, thus I don't have reference to > listData. > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > , "williamkusumo" <williamkusumo@> > wrote: > > > > Hi! > > > > I have a List bounded to a dataProvider and an itemRenderer. Could > > anyone advice me on how I can insert an incremental numeric index in > > each list item (1, 2, 3, and so on)? This list can be re-arranged via > > drag-n-drop, so I can't put the index as part of the data. > > > > Any help will be greatly appreciated. > > > > Thanks! > > >

