There's a setting for the AMF gateway that automatically cases the column
names to lowercase if you're interested. You can view the associated
configurations inside:

<CF install dir>\wwwroot\WEB-INF\flex\services-config.xml

Cheers,

!k

-----Original Message-----
From: Tom Chiverton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 29, 2008 8:40 AM
To: CF-Talk
Subject: Using __type__ to return objects to Flex

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-v
s-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:297687
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to