RE: [flexcoders] Flex Remoting has UPPERCASE results

2005-03-22 Thread Peter Farland

This is an involved discussion with much to consider...

Your request goes something like this when calling CFCs via
RemoteObject:

Flex - Flash - AMF - (AMF Gateway/Flash Remoting) - ColdFusion -
Your CF Page

In ActionScript 1.0, the Flash -- -- AMF interation is case
insensitive merely because ActionScript 1.0 is case insensitive. Java,
on the other hand, always treats properties case sensitively. Flash
Remoting MX uses a convention of lowercase keys to force case
insensitivity in the Java representations of ActionScript objects.
ColdFusion has always been case insensitive - (however, how CF exposes
this to your code versus how objects are passed around internally is
involved) - so it didn't care whether the Java versions of these AMF
objects had lowercase keys.

In ActionScript 2.0, the Flash -- -- AMF interaction became case
sensitive. A switch was introduced in Flex to stop the AMF gateway from
lowercasing keys. This setting is in /WEB-INF/flex/gateway-config.xml
and by default set to false to preserve the case of properties. Again,
ColdFusion code didn't care as it was case insensitive.


However, the response gets more interesting. Your response might look
like this:

ColdFusion - (AMF Gateway/Flash Remoting) - AMF - Flash - Flex

In the simplest of cases, when ColdFusion passes database information
back to Flash Remoting it may do so without subjecting the objects to CF
specific upper casing  (perhaps if you just return a query object).
However, I imagine it is possible that when your code preprocess the
results to form a new structure the variables may actually get forced to
uppercase by CF (I'm not a CF engineer... but it sounds, theoretically,
possible)?

NOTE: as long as the switch is set in Flex to not lowercase keys, I
imagine it will pass through data properties just as ColdFusion sent the
result to the AMF Gateway.

(A more complicated case that I'm assuming doesn't affect you here is
when this switch has been changed to true to lowercase keys in the
gateway - a fix was made in CFMX 7 to handle this situation to still
preserve response property case to the form in which CF returned them).


-Original Message-
From: Scott Barnes [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 22, 2005 6:25 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Flex Remoting has UPPERCASE results



I noticed in:
http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19356

It states:

...With Flash Remoting, they are returned in exactly the same case as
they are typed. For example, if you returned a query with two columns,
(FirstName, LastName), when ColdFusion returns the data through a web
service call, the columns will be all uppercase, (FIRSTNAME,
LASTNAME). If Flash Remoting is used to return the data, then the
columns will appear exactly as they appear in the database,
(FirstName, LastName). MXML is case sensitive, so it is possible that
you may run into a problem with case sensitivity...

Yet, I just spent the last 10mins trying to figure out why my bindings
weren't working - turns out  the struct I return from CFMX is now
uppercase in FLEX - instead of case sensitive which the technote
states.

Personally i prefer uppercase in the end as that way i'm now coupling
my FLEX stuff with how a developer in CFMX typed his variables.


-- 
Regards,
Scott Barnes
http://www.mossyblog.com
http://www.flexcoder.com (Coming Soon)


 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





Re: [flexcoders] Flex Remoting has UPPERCASE results

2005-03-22 Thread Scott Barnes

thanks all for the replies, helped me understand the mechanics of
Remoting and work-arounds.

I still prefer a consistent case to come back (lower/upper) as i think
inheriting case sensitivity from CFMX is bad form?


On Tue, 22 Mar 2005 19:04:42 -0500, Darron J. Schall
[EMAIL PROTECTED] wrote:
 
 Scott Barnes wrote:
 
 I noticed in:
 http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19356
 Yet, I just spent the last 10mins trying to figure out why my bindings
 weren't working - turns out  the struct I return from CFMX is now
 uppercase in FLEX - instead of case sensitive which the technote
 states.
 
 Personally i prefer uppercase in the end as that way i'm now coupling
 my FLEX stuff with how a developer in CFMX typed his variables.
 
 
 
 
 You can preserve the case from the CFMX side.  See my post at:
 http://www.darronschall.com/weblog/archives/000124.cfm
 
 -d
 
 
 Yahoo! Groups Links
 
 
 
 
 


-- 
Regards,
Scott Barnes
http://www.mossyblog.com
http://www.flexcoder.com (Coming Soon)


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] Flex Remoting has UPPERCASE results

2005-03-22 Thread Dirk Eismann

Also check my blog entry on how to transfer data between CF and Flex and 
enforce automatic mapping between structs and AS classes (please note that the 
_remoteClass trick isn't supported officially by MM anymore and may be dropped 
completely in a future version of Flex)

http://www.richinternet.de/blog/index.cfm?entry=74BA931D-C3DA-FDE0-C7959146205942DA

Dirk.

 -Original Message-
 From: Scott Barnes [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 23, 2005 1:45 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Flex Remoting has UPPERCASE results
 
 
 
 thanks all for the replies, helped me understand the mechanics of
 Remoting and work-arounds.
 
 I still prefer a consistent case to come back (lower/upper) as i think
 inheriting case sensitivity from CFMX is bad form?
 
 
 On Tue, 22 Mar 2005 19:04:42 -0500, Darron J. Schall
 [EMAIL PROTECTED] wrote:
  
  Scott Barnes wrote:
  
  I noticed in:
  
 http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_19356
  Yet, I just spent the last 10mins trying to figure out why 
 my bindings
  weren't working - turns out  the struct I return from CFMX is now
  uppercase in FLEX - instead of case sensitive which the technote
  states.
  
  Personally i prefer uppercase in the end as that way i'm 
 now coupling
  my FLEX stuff with how a developer in CFMX typed his variables.
  
  
  
  
  You can preserve the case from the CFMX side.  See my post at:
  http://www.darronschall.com/weblog/archives/000124.cfm
  
  -d
  
  
  Yahoo! Groups Links
  
  
  
  
  
 
 
 -- 
 Regards,
 Scott Barnes
 http://www.mossyblog.com
 http://www.flexcoder.com (Coming Soon)
 
 
  
 Yahoo! Groups Links
 
 
 
  
 
 
 
 


 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/