17 Replies Latest reply on Oct 12, 2010 7:39 PM by jfb00

    Issue with binding data from java to combo box in datagrid item renderer

    KayGee2010

      Hi Flexperts,

       

      I'm making a Remote object call to a Java proxy, the data is coming back fine as I put it in a alert box to check. However, I'm having trouble binding it to a combo box. Here is the code the put the data into an ArrayCollection:

       

       

      [

       

      Bindable]

       

      public var fpers:ArrayCollection;

      private

       

       

      function resultFPERS(event:ResultEvent):

      void

      {

       

      var resultList:ArrayCollection = event.result as ArrayCollection;

      fpers =

      new ArrayCollection();

       

      var resultSize:Number = resultList.length;

       

      for(var i:Number=0; i<resultSize; i++)

      {

       

      var tempFPERS:voFISCPERS = resultList[i] as voFISCPERS;

       

      //Alert.show(tempFPERS.fper_Display);

      fpers.addItem(tempFPERS);

      }

      }

       

       

      Here is my mxml code that tries to bind the data to a combo box using an item renderer in a data grid

       

       

      <mx:DataGridColumn

       

      headerText="From Fiscal Period">

       

      <mx:itemRenderer>

       

      <mx:Component>

       

      <mx:ComboBox dataProvider="{fpers}" />

       

      </mx:Component>

       

      </mx:itemRenderer>

       

      </mx:DataGridColumn>

       

      The above gives me the error : 1120: Access of undefined property fpers.

       

      Can anyone shed some light please?

       

      KG