House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

Using type to return objects to Flex

Author:
Barney Boisvert
02/19/2008 03:26 PM

How 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> > >


Search cf-talk

May 21, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference