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

    combobox and arraycollection

    sxp001 Level 1
      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
      <cfreturn qRead />

      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()">
      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; }
      public var myMD:ArrayCollection;

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

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