In order to return a ColdFusion query object as an Array Collection, you have to be using a remote object (flexgateway in 7.0.2), not a web service.
 
If you need to use web services, you have to turn that query into an array of structures before sending it back.
 
Shan


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of David Smithers
Sent: Thursday, August 24, 2006 12:22 PM
To: [email protected]
Subject: [Junk E-Mail - LOW] [flexcoders] Flex DataGird CFC Query Call Help

Hello,

I'm trying to populate a datagrid with data from a web service. I
do not know what I'm doing wrong please help. Everything compiles
but nothing is populated in the grid.

Here's my CFC Code
<cfcomponent>
<cffunction name="getData" access="remote" returntype="query">
<cfquery name="ELogs" datasource="Error">
SELECT * from ErrorLog
</cfquery>

<cfreturn ELogs>
</cffunction>
</cfcomponent>

Here's my Flex Code
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;

[Bindable]
private var myData:ArrayCollection;

private function resultHandler
(event:ResultEvent):void{
myData = event.result as
ArrayCollection
}
]]>
</mx:Script>
<mx:WebService id="myService"
wsdl="http://www.hawaiihotels.com/WSTest/Simple1.cfc?wsdl"
load="myService.getData();"
result="resultHandler(event)"/>

<mx:DataGrid dataProvider="{myData}"/>
</mx:Application>

Thanks Davide


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.5/426 - Release Date: 8/23/2006

__._,_.___

--
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
Software development tool Software development Software development services
Home design software Software development company


YAHOO! GROUPS LINKS




__,_._,___

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.5/426 - Release Date: 8/23/2006

Reply via email to