Thank you for your help, I finally use this solution :
(In my ItemRenderer)
public override function set data(_data: Object): void {
        removeAllChildren();
        var child: DisplayObject;
        if (_data is A)
                child = addChild(new AItemRenderer());
        else if (_data is B)
                child = addChild(new BItemRenderer());
        IListItemRenderer(child).data = _data;
        __data = _data;
}

Le mercredi 12 juillet 2006 à 19:33 +0200, Ralf Bokelberg a écrit :
> How about using an itemRenderer with states and setting the state
> dependent on the type of data?
> Cheers,
> Ralf.
>
> On 7/12/06, ROUSSELIE David ROSI/SIFAC <[EMAIL PROTECTED]>
> wrote:
> >
> > Hi,
> >
> > I would like to use the List component with different type of data
> in
> > its dataProvider and adapt each itemRenderer depending on the type
> of
> > the data item :
> >
> > var dp: Array = [new A(), new B()]
> > ...
> > <mx:List dataProvider="{dp}" ... />
> >
> > How can I use a "AItemRenderer" to handle A data type elements and
> > "BItemRenderer" to handle B data type elements ?
> >
> > Thanks,
> >
> > --
> > David Rousselie
> >
> > ********************************
> > Ce message et toutes les pieces jointes (ci-apres le "message") sont
> confidentiels et etablis a l'intention exclusive de
> > ses destinataires.
> > Toute utilisation ou diffusion non autorisee est interdite.
> > Tout message electronique est susceptible d'alteration. Le Groupe
> France Telecom decline toute responsabilite au titre de
> > ce message s'il a ete altere, deforme ou falsifie.
> > Si vous n'etes pas destinataire de ce message, merci de le detruire
> immediatement et d'avertir l'expediteur.
> > *********************************
> > This message and any attachments (the "message") are confidential
> and intended solely for the addressees. Any unauthorised
> > use or dissemination is prohibited.
> > Messages are susceptible to alteration. France Telecom Group shall
> not be liable for the message if altered, changed or
> > falsified.
> > If you are not the intended addressee of this message, please cancel
> it immediately and inform the sender.
> > ********************************
> >
> >
> >
> > --
> > Flexcoders Mailing List
> > FAQ:
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives: http://www.mail-archive.com/flexcoders%
> 40yahoogroups.com
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>
> --
> Ralf Bokelberg <[EMAIL PROTECTED]>
> Flex & Flash Consultant based in Cologne/Germany
>
>
>
> 
--
David Rousselie

********************************
Ce message et toutes les pieces jointes (ci-apres le "message") sont 
confidentiels et etablis a l'intention exclusive de
ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration. Le Groupe France 
Telecom decline toute responsabilite au titre de
ce message s'il a ete altere, deforme ou falsifie.
Si vous n'etes pas destinataire de ce message, merci de le detruire 
immediatement et d'avertir l'expediteur.
*********************************
This message and any attachments (the "message") are confidential and intended 
solely for the addressees. Any unauthorised
use or dissemination is prohibited.
Messages are susceptible to alteration. France Telecom Group shall not be 
liable for the message if altered, changed or
falsified.
If you are not the intended addressee of this message, please cancel it 
immediately and inform the sender.
********************************


------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to