Tom, are you sure your keys have the proper case? As far as I know, query
column names are all uppercase so I'm pretty sure that is where the problem
is coming from. To deal with this, I passed a list of property names with
the correct case to the AOP Advice doing this translation (using the
MetadataAwareAdvice that I blogged about) and loop over that list to set the
key names. That worked out fine for me so you can definitely use the
"__type__" approach and have the translate to an ActionScript class with the
proper case. It just won't work using only the query column names as far as
I know.

On Jan 29, 2008 9:39 AM, Tom Chiverton <[EMAIL PROTECTED]> wrote:

> I'm playing with the method that seems to have been hiding from me for a
> while
> at :
>
> http://www.briankotek.com/blog/index.cfm/2008/1/28/Returning-Typed-Structs-vs-CFCs-to-Flex
> to generate arrays of value objects based of a query, without using
> createObject().
> Here, I've given my function a 'results' query, and a 'queryObect' string:
>                <cfset res=ArrayNew(1)>
>                <cfset props=arguments.result.columnlist>
>                <cfoutput query="arguments.result">
>                        <cfset res[arguments.result.currentRow
> ]=structNew()>
>                        <cfset res[arguments.result.currentRow
> ]['__type__']=variables.queryObject>
>                        <cfloop list="#props#" index="prop">
>                                <cfset res[arguments.result.currentRow][prop]
> = arguments.result[prop]
> [arguments.result.currentRow]  >
>                        </cfloop>
>                </cfoutput>
>
> Now, if I CFDUMP 'res', my 'prop's are correctly camelCased - just like in
> the
> query and the ActionScript object I'm aiming at.
>
> *BUT* the "Serializing AMF/HTTP response" output in the ColdFusion log
> file,
> indicates that all the keys of the struct have been changed to uppercase:
> [Flex] Serializing AMF/HTTP response
> Version: 3
>  (Message #0 targetURI=/2/onResult, responseURI=)
>    (Typed Object #0 'flex.messaging.messages.AcknowledgeMessage')
>      timestamp = 1.201616773456E12
>      headers = (Object #1)
>      body = (Object #2)
>        RESULT = "true"
>        DATA = (Array #3)
>          [0] = (Typed Object #4 'reactor.project.foo.To.casesTo')
>            CLAIMHANDLERADRESS = "Senior Legal Counsel  Group Head of
> Claims
> 20 Manchester Square  London  W10 3AN"
>
> And, of course, I get errors in Builders debug console when debugging the
> Flex
> application (before the result handler is called) saying :
> ReferenceError: Error #1056: Cannot create property CLAIMHANDLERADRESS on
> com.halliwells.flex.ici.vo.Cases.
>
> So, can __type__ not be used when properties are mixed case ? Or is there
> an
> alternative approach I've missed ?
> --
> Tom Chiverton
>
> ****************************************************
>
> This email is sent for and on behalf of Halliwells LLP.
>
> Halliwells LLP is a limited liability partnership registered in England
> and Wales under registered number OC307980 whose registered office address
> is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.
>  A list of members is available for inspection at the registered office. Any
> reference to a partner in relation to Halliwells LLP means a member of
> Halliwells LLP.  Regulated by The Solicitors Regulation Authority.
>
> CONFIDENTIALITY
>
> This email is intended only for the use of the addressee named above and
> may be confidential or legally privileged.  If you are not the addressee you
> must not read it and must not use any information contained in nor copy it
> nor inform any person other than Halliwells LLP or the addressee of its
> existence or contents.  If you have received this email in error please
> delete it and notify Halliwells LLP IT Department on 0870 365 2500.
>
> For more information about Halliwells LLP visit www.halliwells.com.
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297639
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to