4 Replies Latest reply on May 5, 2011 8:23 AM by Yozef0

    Skins ArrayCollection as dataprovider to an ItemRenderer of a List

    Yozef0 Level 1

      Objective: I would like to pass Skins to an itemRenderer (which is a Button) of a List, and be able to skin every button in that List.

      This is what I have:

       

      List:

      <s:List itemRenderer="renderers.ItemRenderer" dataProvider="{collectionWorkspace}" />
      

       

      ArrayCollection:

      <s:ArrayCollection id="collectionWorkspace">
          <comp:Layout1 />
          <comp:Layout2 />
          <comp:Layout3 />
          <comp:Layout4 />
          <comp:Layout5 />
      </s:ArrayCollection>
      

      The Layouts are Skin classes with HostComponent Button.

       

      ItemRenderer:

      <?xml version="1.0" encoding="utf-8"?>
      <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:mx="library://ns.adobe.com/flex/halo"
                      xmlns:s="library://ns.adobe.com/flex/spark">
      
          <s:states>
              <s:State name="normal" />
          </s:states>
      
          <s:Button skinClass="{data}"/>
      
      </s:ItemRenderer>
      

       

      I get an error (fixed for clarification): Error: Skin for Application....Button1 cannot be found.