Nevermind. This works now:
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute">
 
 <mx:RemoteObject
     id="myCfc"
     destination="ColdFusion"
     source="flex.cfc.flextest"
     result="resultHandler(event)"
     />
    
     <mx:Script>
      <![CDATA[
       import mx.collections.ArrayCollection;
       import mx.rpc.events.ResultEvent;
       import flash.util.trace;
       import mx.utils.*;
       
       [Bindable]
       private var queryresult:ArrayCollection;
      
       private function resultHandler( event:ResultEvent ):void
        {
        trace(ObjectUtil.toString(event.result));
        queryresult = event.result as ArrayCollection;
        }
       
      ]]>
     </mx:Script>
 
 <mx:Button label="get Query" click="myCfc.getQuery()" x="250" y="186"/>
 
 <mx:DataGrid x="121" y="235" id="dg" dataProvider="{queryresult}">
  <mx:columns>
   <mx:DataGridColumn headerText="LastName" dataField="LastName"/>
   <mx:DataGridColumn headerText="Title" dataField="Title"/>
   <mx:DataGridColumn headerText="ISBN" dataField="ISBN"/>
  </mx:columns>
 </mx:DataGrid>
 
</mx:Application>
 
 
I think it was a case issue, dataField and actual query columname need to match exactly.
 
Stefan
 
 
 
 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Stefan Richter
Sent: 31 March 2006 17:00
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Setting up Remoting

Update: I can now see the ISBN number if I do this:
 
       private function resultHandler( event:ResultEvent ):void
        {
        trace(ObjectUtil.toString(event.result));
        queryresult = event.result as ArrayCollection;
        }
 
The other 2 fields do not show though...?
 
Stefan
 


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to