0

I am facing with a basic problem, that i can not handle. I want to display datas in a Spark List.It works fin until i want to display image in it from xml. I know that i have to use some kind of itemRenderer, but i dont know how. I read several articles about it but didnt found any solvation.

This one is allmost good, but i want to display the pictures in the list

My code looks like this:

<?xml version="1.0" encoding="utf-8"?><s:View xmlns:fx="http://ns.adobe.com/mxml/2009"xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:employees="services.employees.*"
    title="HomeView">
<fx:Script>
    <![CDATA[
        import mx.events.FlexEvent;

        protected function list_creationCompleteHandler(event:FlexEvent):void
        {
            getDataResult.token = employees.getData();
        }

    ]]>
</fx:Script>
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    <s:HTTPService id="srv" url="employees.xml"/>
    <s:CallResponder id="getDataResult"/>
    <employees:Employees id="employees"/>
</fx:Declarations>
<s:List id="list" left="0" right="0" top="0" bottom="0"
        creationComplete="list_creationCompleteHandler(event)" labelField="picture">
    <s:AsyncListView list="{getDataResult.lastResult}"/>
</s:List></s:View>

I would be so greatfull for any help.

Thank you everyone!

1 Answers1

0

See the first example of this link

http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_8.html

Although this is Flex 3, Flex 4's ItemRenderer model is still the same.

Harry Ninh
  • 16,288
  • 5
  • 60
  • 54