12 Replies Latest reply on Feb 25, 2008 10:23 AM by ntsiii

    combobox and arraycollection

    sxp001
      Hi all,
      I am totaly new with Flex, and need your help.
      I have a ArrayCollection getMD that saved the field passed from coldfusion cfc
      ++++++++++++++++++++++++++++++
      <cfcomponent output="false">
      <cffunction name="getMD" access="remote" returntype="query" output="false">
      <cfset var qRead = "" />
      <cfquery datasource="lds_clin" name="qRead">
      select md_name from lds.mdmas
      </cfquery>
      <cfreturn qRead />
      </cffunction>
      </cfcomponent>
      +++++++++++++++++++++++++++++

      What I doing wrong that my combobox don't have a value from database? My mxml is looking like this:
      ++++++++++++
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()">
      <mx:Script>
      <![CDATA[
      import mx.rpc.events.ResultEvent;
      import mx.collections.ArrayCollection;
      public function initApp():void {
      ro.getMD(); }
      private function handleMDResult(event:Object):void {
      myMD = event.result as ArrayCollection; }
      [Bindable]
      public var myMD:ArrayCollection;
      ]]>
      </mx:Script>

      <mx:RemoteObject id="ro" destination="ColdFusion" source="apps.ria.DR.cfcs.GetData" >
      <mx:method name="getMD" result="handleMDResult(event)" />
      </mx:RemoteObject>

      <mx:ComboBox id="cboMD" dataProvider="{myMD}" x="10" y="246" width="231"></mx:ComboBox>
      </mx:Application>

      THANKS!
      Slava