|
Mailing Lists
|
Home / Groups / ColdFusion Talk (CF-Talk)
Using type to return objects to FlexHow are you calling it from Flex? __type__ only works with FDS, I believe, not with remote objects. cheers, barneyb On Feb 19, 2008 10:54 AM, Gareth Arch <Lampei@yahoo.com> wrote: > I am giving this a try on my current app. However, when the data is returned to Flex, it is not of the type that I specified. All fields are camelCased correctly (I added the properties argument to get around the uppercasing issue), the type is set correctly, and all data is returned, but it is not of type "AddressBook". If I do <cfreturn createObject( "component", "AddressBook" ).init( arguments.id ) /> the data is returned as "AddressBook". Any ideas? (Code is below). > > <cffunction name="getAllProperties" output="false" access="remote"> > <cfargument name="queryData" type="query" required="true" /> > <cfargument name="properties" type="string" required="false" default="addressBookId,ownerId,connectionSourceId,addressTypeId,address1,address2,city,state,zip,countryId,longitude,latitude,radianLat,radianLong,lastUpdate,lastUpdateBy,lastUpdateByConnectionSourceId" /> > > <cfset var INST = structNew() /> > <cfset INST.obj = structNew() /> > <cfset INST.ret = arrayNew( 1 ) /> > > <!--- default object to addressbook ---> > <cfset INST.obj['__type__'] = "AddressBook" /> > <!--- loop over query ---> > <cfloop query="arguments.queryData"> > <!--- loop over columns and assign to temporary object ---> > <cfloop list="#arguments.properties#" index="INST.property"> > <cfset INST.obj[INST.property] = arguments.queryData[INST.property][currentRow] /> > </cfloop> > <cfscript> > ArrayAppend( INST.ret, duplicate( INST.obj ) ); > </cfscript> > </cfloop> > > <cfreturn INST.ret /> > </cffunction> > > |
May 21, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||