2 Replies Latest reply on Dec 8, 2006 8:40 AM by Kyle.Hayes

    Sending Data to an ItemEditor

    Kyle.Hayes
      I would like to know how to send an array of strings to the a comboBox dataProvider which is acting as an itemEditor for my DataGrid. Here is some code:

      initVars is called on creationComplete:
      -------------------------------
      <mx:Script>
      <![CDATA[

      [Bindable]
      public var allDescriptions:Array;


      private function initVars():void{
      artService.getDescriptions();
      }

      private function getDescriptionHandler(event:ResultEvent):void{
      allDescriptions = event.result as Array;
      }
      ]]>
      </mx:Script>
      -----------------------------------------
      <mx:RemoteObject id="artService" destination="ColdFusion" source="MyFirst.ARTGateway" showBusyCursor="true">
      <mx:method name="getDescriptions" result="getDescriptionHandler(event)" fault="Alert.show(event.fault.message)" />
      </mx:RemoteObject>

      ---------------------------------------------
      <mx:DataGridColumn id="descriptionField" dataField="DESCRIPTION" headerText="Description" editorDataField="myData">
      <mx:itemEditor>
      <mx:Component>
      <comp:descriptionEditor dataProvider=" {allDescriptions}" />
      </mx:Component>
      </mx:itemEditor>
      </mx:DataGridColumn>
      --------------------------------------------

      The bolded text is me trying to send the public array "allDescriptions" into the dataProvider for my itemEditor? Flex however returns a line edit "Access of undefined property allDescriptions". How do I send this array?