Dan, I see the same output (below) as you have described.  Either way,
maybe this should be an ER since CF retains the camelCase in some
instances, so why not pass it through to the JS?

upper case - struct
CAMELCASE       key is stored in uppercase

camel-case - struct
camelCase       key is stored in camel-case

s1 = new Object(); s1["camelcase"] = "key is stored in uppercase";
s2 = new Object(); s2["camelcase"] = "key is stored in camel-case"; 


Thanks
M!ke

-----Original Message-----
From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 19, 2005 8:17 PM
To: CF-Talk
Subject: RE: Known Bug in CFWDDX CFML2JS Variable Name Case?

Michael,

Run the following code:

<cfscript>
s1 = structNew();
s1.camelCase = "key is stored in uppercase";

s2 = structNew();
s2["camelCase"] = "key is stored in camel-case"; </cfscript>

<cfdump var="#s1#" label="upper case" /> <br /> <cfdump var="#s2#"
label="camel-case" />

<cfwddx action="cfml2js" input="#s1#" toplevelvariable="s1" /> <cfwddx
action="cfml2js" input="#s2#" toplevelvariable="s2" />

Notice that CF stores camel-case keys if the brackets are used. In both
cases the keys are converted to lowercase in JavaScript.

Personally, while I use camelcase as well, it simplifies things greatly
that it's all lowercase. It makes things consistent and you don't worry
have to worry about a developer writing code that uses different case
typing.
Granted, hopefully we'll all coding under strict guidelines, but that's
not always the case--especially when doing temporary contracting work.

-Dan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227330
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to