I have a function that returns a struct:
<cffunction name="getChartData" access="remote"
returntype="struct">
<cfargument name="userID" required="true"
type="numeric">
<cfquery name="chart" datasource="#datasource#">
select *
from data where userID = <cfqueryparam
value="#arguments.userID#" cfsqltype="cf_sql_integer">
</cfquery>
<cfquery name="comments" datasource="#datasource#">
select comment,dateAdded
from comments where userID = <cfqueryparam
value="#arguments.userID#" cfsqltype="cf_sql_integer">
</cfquery>
<cfset struct.chart = chart>
<cfset struct.comments = comments>
<cfset flash.result = struct>
<cfreturn flash.result>
</cffunction>
I am having trouble parsing out the struct as array
collections in flex as follows:
private function handleChartData(event:ResultEvent):void{
var fullArray:ArrayCollection = event.result.chart as
ArrayCollection ;
comments.dataProvider = event.result.comments as
ArrayCollection ;
debug.dataProvider = fullArray;
}
Is there anything that I am doing wrong?