ColdFusion is case-insensitive, and Flex MXML and ActionScript are very case-sensitive. For consistency’s sake, when ColdFusion variables are sent from ColdFusion to the Flash Player via Flash Remoting, names are converted to uppercase (that’s the default behavior, and it can be changed if needed). So, a structure member named FirstName will be named FIRSTNAME when it arrives on the Flash Player (and referring to it as FirstName in MXML or ActionScript won’t work).
But, you actually can force case to be maintained in structures, depending on how structure members are defined. Look at these two examples. The first won’t preserve case:



In this example, if the structure were returned to the Flash Player, the members would be named FIRSTNAME and LASTNAME.
Here’s another example, one that will indeed preserve case:



This example accomplishes the exact same result as the previous example, in that it creates a structure and defines two members. But in this example, structure member names will be preserved, and they would indeed be named FirstName and LastName when they arrive in the Flash Player.

9 thoughts

  1. Ben said: "For consistency’s sake, when ColdFusion variables are sent from ColdFusion to the Flash Player via Flash Remoting, names are converted to uppercase (that’s the default behavior, and it can be changed if needed)."
    The solution posted here is the way to change what you name "default behavior", or is there a way to do it directly on CF’s Flash Remoting config?
    Thank you Ben!

  2. Vicente,
    The default is all uppercase, but you can change to that to force to all lowercase by setting the <force-cfc-lowercase> <force-query-lowercase> and <force-query-lowercase> (in the remoting-config file) properties to true. However, if you do so, the names will be converted to lowercase, and they’ll still not be in the mixed case they were originally in the example I posted.
    — Ben

  3. Thank you Ben!
    So, as I’d checked on WEB-INFFlexdata-management-config.xml and WEB-INFFlexremoting-config.xml, there’s no way to make CF keep mixed case as default.

  4. @Eric
    No, I don’t think so.
    You could use AOP (i.e. ColdSpring) to convert the query into an array of VO fairly easily though.
    Using VO on both the Flex and ColdSpring ends is the other way to preserve case in properties, just make sure the C

  5. If you are using MySQL Ver 5.0 JDBC drivers mysql-connector-java-5.1.6-bin.jar
    the case is being preserved.
    SELECT FirstName, LastName from Users = "FirstName" & "LastName"
    SELECT FIRSTNAME, LASTNAME from Users = "FIRSTNAME" & "LASTNAME"
    Tom, thanks for the alias and [RemoteClass] match… will keep that in mind.
    -Hem

  6. Thanks Tom. I’m returning query Objects from CFC to my Flex application, and then creating Class Objects with properties for each record. I don’t like having the properties in ALL CAPS, because it doesn’t coincide with my Naming Conventions. Guess it’s just something I’ll have to deal with, or write another script to convert the case.

Leave a Reply to Mike Kelp Cancel reply