"getItemIndex()" is a method of  collections.  I'd advise creating a
bindable instance variable typed as a collection (XMLListCollection or
ArrayCollection), and assigning its value in a result handler.  Bind the
list to that var.  Then you can do:

value="{outerDocument.acData.getItemIndex(data)"

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of bmilesp
Sent: Wednesday, December 19, 2007 2:23 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: itemrenderer dataprovider index?

 

i've already tried getItemIndex and failed, i suppose that i'm 
implementing it wrong. I've attempted a number of times similar to 
this attempt:

<mx:List dataprovider="dProvider.incrementalData">
<mx:itemrenderer>
<mx:component>
<p:custom_component dataProvider="{data.element}" 
value="{outerDocument.dataModel.dataVal[getItemIndex(this)]}">
</mx:component>
</mx:itemRenderer>
</mx:list>

thie idea is this: as each component in the itemrenderer increments, 
it will bind to the dataModel.dataVal[index] to retrieve it's value. 
But obviously getItemIndex in this case doesn't work. Any other 
ideas? thx in advance -b

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> You can call getItemIndex if you want
> 
> 
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of bmilesp
> Sent: Tuesday, December 18, 2007 7:18 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] itemrenderer dataprovider index?
> 
> 
> 
> greetings!
> 
> I have an mx:List with an itemrenderer that renders a custom 
> component using a dataprovider. i want to get the rendered item 
index 
> (or current dataprovider index?) of each custom component in the 
> list. 
> 
> or even just an incrementing number inside of the component would 
> work. 
> 
> so I wish to write something like: 
> 
> <p:custom_component dataProvider="{data}" 
> value="{outerDocument.dataModel.dataVal[i]}">
> 
> "i" being the current index of the rendered item
> 
> Any Clues? thanks everyone!
>

 

Reply via email to