7 Replies Latest reply on Jan 7, 2011 11:08 AM by Zolotoj

    custom item renderer and listData not being set

    Zolotoj Level 3

      I need to understand why listData is not set when I use the following code:

       

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

      A fragment of sparkDropDownDataGrid:

       

      import flash.events.Event;
           
      import mx.controls.listClasses.BaseListData;
      import mx.controls.listClasses.IDropInListItemRenderer;
           
      import spark.components.DropDownList;
      import mx.controls.DataGrid;
      import spark.components.supportClasses.DropDownListBase;
      import spark.skins.spark.DropDownListSkin;
      
      public class sparkDropDownDataGrid extends DropDownList implements IDropInListItemRenderer
      {
      private var _selectedValue:String;
                private var _listData:BaseListData;
                public function sparkDropDownDataGrid()
                {
                     super();
                     addEventListener("change", onDataChange);
                }
                public function get listData():BaseListData
                {
                     return _listData;
                }
                
                public function set listData(value:BaseListData):void
                {
                     trace("ListData: " + value);
                     _listData = value;
                }
      
      .....
      

       

      Thanks