3 Replies Latest reply on Jan 6, 2011 11:42 AM by Zolotoj

    Error while creating a custom combobox for Spark DataGrid

    Zolotoj Level 3

      I am getting the following run time error:

      Error: Required skin part openButton cannot be found.
          atspark.components.supportClasses::SkinnableComponent/findSkinParts() [E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\componen ts\supportClasses\SkinnableComponent.as:671]
          atspark.components.supportClasses::SkinnableComponent/attachSkin()[E: \dev\hero_private_beta\frameworks\projects\spark\src\spark\components\ supportClasses\SkinnableComponent.as:646]
          atspark.components.supportClasses::SkinnableComponent/validateSkinCha nge()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\com ponents\supportClasses\SkinnableComponent.as:406]
          atspark.components.supportClasses::SkinnableComponent/commitPropertie s()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\compo nents\supportClasses\SkinnableComponent.as:420]
           atspark.components.supportClasses::ListBase/commitProperties()[E:\dev  \hero_private_beta\frameworks\projects\spark\src\spark\components\supp  ortClasses\ListBase.as:808]
          atspark.components::List/commitProperties()[E:\dev\hero_private_beta\ frameworks\projects\spark\src\spark\components\List.as:954]
          atspark.components.supportClasses::DropDownListBase/commitProperties( )[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\compone nts\supportClasses\DropDownListBase.as:504]
          atspark.components::ComboBox/commitProperties()[E:\dev\hero_private_b eta\frameworks\projects\spark\src\spark\components\ComboBox.as:644]
          atmx.core::UIComponent/validateProperties()[E:\dev\hero_private_beta\ frameworks\projects\framework\src\mx\core\UIComponent.as:8095]
           atmx.managers::LayoutManager/validateClient()[E:\dev\hero_private_bet  a\frameworks\projects\framework\src\mx\managers\LayoutManager.as:934]
          atmx.core::UIComponent/validateNow()[E:\dev\hero_private_beta\framewo rks\projects\framework\src\mx\core\UIComponent.as:7953]
          atspark.components.supportClasses::GridLayout/layoutItemRenderer()[E: \dev\hero_private_beta\frameworks\projects\spark\src\spark\components\ supportClasses\GridLayout.as:1808]
          atspark.components.supportClasses::GridLayout/createTypicalItemRender er()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\comp onents\supportClasses\GridLayout.as:460]
          atspark.components.supportClasses::GridLayout/updateTypicalCellSizes( )[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\compone nts\supportClasses\GridLayout.as:514]
          atspark.components.supportClasses::GridLayout/layoutColumns()[E:\dev\ hero_private_beta\frameworks\projects\spark\src\spark\components\suppo rtClasses\GridLayout.as:570]
          atspark.components.supportClasses::GridLayout/measure()[E:\dev\hero_p rivate_beta\frameworks\projects\spark\src\spark\components\supportClas ses\GridLayout.as:230]
           atspark.components.supportClasses::GroupBase/measure()[E:\dev\hero_pr  ivate_beta\frameworks\projects\spark\src\spark\components\supportClass  es\GroupBase.as:1109]
          atmx.core::UIComponent/measureSizes()[E:\dev\hero_private_beta\framew orks\projects\framework\src\mx\core\UIComponent.as:8383]
          atmx.core::UIComponent/validateSize()[E:\dev\hero_private_beta\framew orks\projects\framework\src\mx\core\UIComponent.as:8307]
          atspark.components::Group/validateSize()[E:\dev\hero_private_beta\fra meworks\projects\spark\src\spark\components\Group.as:956]
          atmx.managers::LayoutManager/validateSize()[E:\dev\hero_private_beta\ frameworks\projects\framework\src\mx\managers\LayoutManager.as:659]
          atmx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\hero_priv ate_beta\frameworks\projects\framework\src\mx\managers\LayoutManager.a s:793]
          atmx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\h ero_private_beta\frameworks\projects\framework\src\mx\managers\LayoutM anager.as:1157]

       

      Here is my combobox:

      package
      {
          import mx.controls.listClasses.BaseListData;
          import mx.controls.listClasses.IDropInListItemRenderer;
         
          import spark.components.ComboBox;
         
          public class sparkComboRendererDataGrid extends ComboBox implements IDropInListItemRenderer
          {
              public function sparkComboRendererDataGrid()
              {
                  super();
              }
             
              public function get listData():BaseListData
              {
                  return null;
              }
             
              public function set listData(value:BaseListData):void
              {
              }
              override public function set dataProvider(value:Object):void
              {
                  super.dataProvider = value;
                  // This may get called before dataProvider is set, so make sure not null and has entries
                  if (value!=null && value.length)
                  {
                      // Got it, set flag
                      bDataProviderSet = true;              
                  }  
              }
          }
      }

       

      and here is the implementation:

      var PersonnelPerson:ClassFactory = new ClassFactory(sparkComboRendererDataGrid);
      PersonnelPerson.properties = {labelField : "person", dataProvider :
      new XMLListCollection(dataList.consistcrew)};
      var col:GridColumn = GridColumn(personnel.columns.getItemAt(0));                   
      col.itemRenderer = PersonnelPerson;

       

      Please help.

       

      Thanks