Flex and ColdFusion Objects
Recently ran into something very strange. I was returning a structure to Flex from a ColdFusion Component and FLEX was receiving the structure keys as all UPPERCASE.
Take the following component.
<cfcomponent>
<cffunction name="helloWorld" access="remote">
<cfset var result = structNew() />
<cfset result.msg = "Hello World!" />
<cfreturn result />
</cffunction>
</cfcomponent>
When called from Flex, the result will come back as
result.MSG
I guess ColdFusion doesn't see the case being used in the struct.key assinment. If you want to retain the case of your structure keys you need to assign them like this..
<cfcomponent>
<cffunction name="helloWorld" access="remote">
<cfset var result = structNew() />
<cfset result["msg"] = "Hello World!" />
<cfreturn result />
</cffunction>
</cfcomponent>
Creating your structures this way will retain the case of your keys and Flex will receive them in the way you have named them.
1 comments - Posted by Steve Onnis at 11:17 AM - Categories: Coldfusion | Coldfusion Server | Flex