4 Replies Latest reply on Dec 15, 2008 6:03 AM by Gene Godsey

    What am I doing wrong here??????

    Gene Godsey Level 1
      Heree is my mxml file.
      --------------------------------
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical"
      creationComplete="initApp()" xmlns:views="view.*">

      <mx:Script>
      <![CDATA[
      import mx.rpc.events.ResultEvent;
      import mx.rpc.remoting.mxml.RemoteObject;
      import mx.collections.ArrayCollection;

      private var ADATResults:ArrayCollection;
      private var ADATData:RemoteObject

      private function initApp():void{
      ADATData = new RemoteObject("ColdFusion");
      ADATData.source = "chapter26-debug.chapter26.ADATData";
      ADATData.addEventListener(ResultEvent.RESULT, resultHandler);
      }

      private function resultHandler(event:ResultEvent):void{
      ADATResults = event.result as ArrayCollection;
      }

      ]]>
      </mx:Script>

      <mx:DataGrid dataProvider="{ADATResults}">
      <mx:columns>
      <mx:DataGridColumn dataField="nameofcomputer" headerText="Computer Name"/>
      <mx:DataGridColumn dataField="serialnumber" headerText="Serial Number"/>
      <mx:DataGridColumn dataField="puser" headerText="User Name"/>
      </mx:columns>
      </mx:DataGrid>

      <mx:Button id="collectData" label="Get The Records" click="ADATData.getAllADATData()"/>

      </mx:Application>
      ------------------------------

      Here is my CFC:
      -----------------------------
      <cfcomponent output="false">

      <cffunction name="getAllADATData" access="remote" returntype="query">
      <cfset var = "myQuery">
      <cfquery name="myQuery" datasource="adat2005" dbtype="ODBC">
      select autoid, nameofcomputer, serialnumber, puser
      from adat2005_main
      where nameofcomputer like '%stewdoim%'
      order by nameofcomputer
      </cfquery>
      <cfreturn myQuery>
      </cffunction>

      </cfcomponent>
      ---------------------------

      Whay am I Now getting any data to return in the grid?