Inline Renderer with Complex Objects : List Renderer « Components « Flex






Inline Renderer with Complex Objects

Inline Renderer with Complex Objects
          
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#EEEEEE">
 <mx:ArrayCollection id="answerData">
   <mx:Object>
     <mx:value>Yes</mx:value>
     <mx:imageSource>a.png</mx:imageSource>
   </mx:Object>
   <mx:Object>
     <mx:value>No</mx:value>
     <mx:imageSource>a.png</mx:imageSource>
   </mx:Object>
   <mx:Object>
     <mx:value>Maybe</mx:value>
     <mx:imageSource>a.png</mx:imageSource>
   </mx:Object>
 </mx:ArrayCollection>
 
  <mx:List id="myList" dataProvider="{answerData}" rowCount="{answerData.length}" variableRowHeight="true" width="80" height="140">
    <mx:itemRenderer>
      <mx:Component>
        <mx:Image source="{data.imageSource}"/>
      </mx:Component>
    </mx:itemRenderer>
  </mx:List>  
  <mx:Label text="{myList.selectedItem.value}" fontSize="14"/>    
</mx:Application>

   
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.DropIn RendererDropIn Renderer
2.Inline RendererInline Renderer
3.List control uses default item renderer to display stringsList control uses default item renderer to display strings
4.Renderer and Editor for ListRenderer and Editor for List
5.List control uses the default item renderer to display each of the three strings that represent postal codes for Alaska, Alabama, and Arkansas.List control uses the default item renderer to display each of the three strings that represent postal codes for Alaska, Alabama, and Arkansas.
6.Using Image renderer for ListUsing Image renderer for List
7.Specifying an icon to the List controlSpecifying an icon to the List control
8.Editable ListEditable List
9.Create an Editable ListCreate an Editable List