You need to call collectionData.refresh() when the data property changes for
the itemRenderer. One way to do it would be:
<mx:Binding source="data" destination="dataChanged"/>
then add the method:
private function dataChanged(data:Object):void {
collectionData.refresh();
}
Hopefully that does it.
Scott
On Tue, Jul 22, 2008 at 10:23 AM, luis_roman_am <[EMAIL PROTECTED]>
wrote:
> Lets try to add more info. Theres a TileList with a ItemRenderer. The
> ItemRenderer code is:
>
> <mx:Script>
> <![CDATA[
>
> import mx.core.Application;
> import mx.collections.ArrayCollection;
>
> [Bindable]
> private var collectionData:ArrayCollection;
>
> private function init():void
> {
> collectionData = MyArrayCollection
> collectionData.filterFunction= filterUrl;
>
> collectionData.refresh();
>
> }
>
> private function filterUrl(item:Object):Boolean
> {
> return item.Url == data.Url;
> }
> ]]>
> </mx:Script>
>
> "MyArrayCollection" has (example)200 arrays with lot of data and some
> of them (example, 50 of them) have the same "url" value
> (url=www.test.com) . The linearChart has as dataprovider "collectionData".
>
> I want to filter the item renderer (and his linearchart) with this.
> The problem is that when i launch the app the tilelist and the
> itemrenderer repeat the same linearchart in all the renderers.
>
> I know im close!! Please help!
>
>
> --- In [email protected] <flexcoders%40yahoogroups.com>, "Scott
> Bachman" <[EMAIL PROTECTED]>
> wrote:
> >
> > I'm not sure I understand your question. You can certainly refer to
> data.Url
> > inside the item renderer. If you mean using a filterFunction with
> data.Url,
> > you would have to apply it inside you're item renderer and most
> likely make
> > a copy of your original ArrayCollection in each itemRenderer to
> apply the
> > filterFunction to so that each renderer is filtered without
> affecting the
> > others.
> >
> > Scott
> >
> > On Tue, Jul 22, 2008 at 4:00 AM, luis_roman_am <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Thanks, Scott. Taking this way, i have another doubt. How can i
> refer
> > > (inside a item renderer) to the "data.Url" inherited from the
> > > dataprovider in the main application (index.mxml)?
> > >
> > > --- In [email protected]
> > > <flexcoders%40yahoogroups.com><flexcoders%
> 40yahoogroups.com>,
>
> "Scott
> > > Bachman" <scott.bachman@>
> > > wrote:
> > >
> > > >
> > > > The syntax you tried is e4x (ECMAscript for XML) and only works
> with XML
> > > > data. For an ArrayCollection you could use a filterFunction to
> > > filter the
> > > > data. Check out, for instance,
> > > >
> http://www.boyzoid.com/blog/index.cfm/2006/10/19/Filtering-Data-in-Flex
> > > > or the filterFunction property of ArrayCollection in the Flex
> > > documentation.
> > > >
> > > > Scott
> > > >
> > > >
> > > >
> > > > On Mon, Jul 21, 2008 at 9:28 AM, luis_roman_am <luis_roman_am@>
> > > > wrote:
> > > >
> > > > > Hi people! Situation as follows:
> > > > >
> > > > > MYARRAYCOLLECTION (Example fields)
> > > > > - TITLE
> > > > > - URL
> > > > >
> > > > > INDEX.MXML
> > > > > - TILELIST
> > > > > - DataProvider="{MyArrayCollection}"
> > > > > - ItemRenderer ="MyRenderer"
> > > > >
> > > > > MYRENDERER.MXML
> > > > > - LABEL (data.TITLE) (WORKS FINE)
> > > > > - LINECHART
> > > > > -DataProvider="Application.application.MyArrayCollection}
> > > > > (PROBLEM HERE)
> > > > >
> > > > > THe problem is: How can i filter linechart inside
> MYRENDERER.MXML the
> > > > > dataprovider to receive only data for the items with his URL?
> > > > >
> > > > > I tried something like:
> > > > >
> > > > >
> > >
> -DataProvider="Application.application.MyArrayCollection.(@Url=data.Url)}
> > > > >
> > > > > but this throws me the following error:
> > > > >
> > > > > Error #1123: Filter operator not supported on type
> > > mx.arraycollections.
> > > > >
> > > > > Please Help!!
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> >
>
>
>