1 Reply Latest reply on Feb 3, 2012 10:26 AM by mitz11

    Skinning a custom List

    mitz11 Level 1

      I'm trying to create a list with some custom functionality, and I want to be able to re-use it with different skins for different situations.  I made a simple list class, and started filling out it's functionality, then I realized I couldn't set the skinClass property from outside anymore!

       

      So, in a file called CustomList.mxml within an RSL library, I define the most basic sparks list:

       

      <s:List xmlns:fx="http://ns.adobe.com/mxml/2009"

                                                          xmlns:s="library://ns.adobe.com/flex/spark"

                                                          xmlns:mx="library://ns.adobe.com/flex/mx">

                <fx:Declarations>

                          <!-- Place non-visual elements (e.g., services, value objects) here -->

                </fx:Declarations>

       

       

      </s:List>

       

      Then, in a module, I create one of these lists and try to assign it a skin class:

       

      <CustomList id="receiptList"  height="100%" width="100%" skinClass="skins.CustomListSkin" itemRenderer="renderers.CustomItemRenderer" />

       

      And I get a compiler error:  Cannot resolve attribute "SkinClass" for component type controls.CustomList.

       

      Why can I not do this?  I could set the skinclass directly in customlist.mxml in the tag at the top, but it is inaccessible from outside!  Also, if I changed the tag in the module to say just "s:List" instead of "CustomList", it works fine.  Can someone point me in the right direction?