RE: CFWDDX converts to lower case?
Because before cfmx, structures in CF couldn't preserve the case of the keys. So when you convert it to js, they needed a consistent way of creating property names. They chose lower case. They really didn't have the option to keep your original case. Bottom line: CF is case insensitive and anything going through it could loose case. Pascal -Original Message- From: Claude Schneegans [mailto:[EMAIL PROTECTED] Sent: donderdag 25 maart 2004 21:59 To: CF-Talk Subject: Re: CFWDDX converts to lower case? I guess your only option This is was I was affraid of. However, I finally found simpler to modify the names used like tableLeft to table_left, so it is not affected by lowe case. Thanks. But still, I wonder why the developers of WDDX decided to use this lower case which nobody needs anyway? And worse, not documented this feature. -- ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: [EMAIL PROTECTED] Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CFWDDX converts to lower case?
CF is case insensitive and anything going through it could loose case. I understand. Actually what I want is to save a JS structure in a database, and later restore the JS structure. I don't need the use structure in CF, but there is no other to recreate the structure in JS. -- ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: [EMAIL PROTECTED] Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CFWDDX converts to lower case?
What kind of a JS structure? On Mar 26, 2004, at 9:12 AM, Claude Schneegans wrote: CF is case insensitive and anything going through it could loose case. I understand. Actually what I want is to save a JS structure in a database, and later restore the JS structure. I don't need the use structure in CF, but there is no other to recreate the structure in JS. -- ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: [EMAIL PROTECTED] Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CFWDDX converts to lower case?
What kind of a JS structure? Rather complex: a bunch of variables and arrays containing variables and other arrays... -- ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: [EMAIL PROTECTED] Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CFWDDX converts to lower case?
OK I am late to this thread I already deleted most of the message. But, WDDX itself does not change the case of packet contents. the_javascript_ routines *may *do this (at least to column names in a query) Looking at the WDDX _javascript_ supplied by CFMX, it appears that you can control if you set a variable: 636 /// 637 // WddxRecordset([flagPreserveFieldCase]) creates an empty recordset. 638 // WddxRecordset(columns [, flagPreserveFieldCase]) creates a recordset 639 //with a given set of columns provided as an array of strings. 640 // WddxRecordset(columns, rows [, flagPreserveFieldCase]) creates a 641 //recordset with these columns and some number of rows. 642 // In all cases, flagPreserveFieldCase determines whether the exact case 643 //of field names is preserved. If omitted, the default value is false 644 //which means that all field names will be lowercased. 645 function WddxRecordset() 646 { 647 // Add default properties 648 this.preserveFieldCase = false; If this doesn't solve the problem, you can ryo_javascript_ routines (using the WDDX.js as a guide. HTH Dick On Mar 26, 2004, at 10:19 AM, Claude Schneegans wrote: What kind of a JS structure? Rather complex: a bunch of variables and arrays containing variables and other arrays... -- ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: [EMAIL PROTECTED] Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CFWDDX converts to lower case?
But, WDDX itself does not change the case of packet contents. Under CF 5, CFWDDX does. -- ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: [EMAIL PROTECTED] Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CFWDDX converts to lower case?
Aw, geeze... sorry man. 1) WDDX packet serialized at server 2) WDDX packet deserialized at client 3) WDDX packet serialized at client 4) WDDX packet deserialized a Server Where, above, does this lc conversion occur (could be multiple)? how deep do your js arrays within arrays go? I didn't think WDDX.js handled nested arrays -- just parallel arrays like it uses in its recordset. Dick On Mar 26, 2004, at 12:09 PM, Claude Schneegans wrote: But, WDDX itself does not change the case of packet contents. Under CF 5, CFWDDX does. -- ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: [EMAIL PROTECTED] Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CFWDDX converts to lower case?
1) WDDX packet serialized at server 2) WDDX packet deserialized at client 3) WDDX packet serialized at client 4) WDDX packet deserialized a Server Where, above, does this lc conversion occur (could be multiple)? 3 and 4, I didn't try 1 2. with WDDX packet serialized at client however, there is an undocumented property of the wddxSerializer object which allows to deactivate the lower case function. But I haven't find any in the CFWDDX tag for the server part. I solved this problem by using only lower case variables names. But the other issue is the ridiculous amout of text generated by the WDDX format. What I'm doing: 1. create a data structure in clent _javascript_, 2. serialize it and send it as text in a hidden field back to the server, 3. the server stores it in the database. later : the server can read it back, deserialize it, regenerate the data structure in _javascript_ and send it to the client. But the WDDX structure need more than 64k . So I tried to deserialize before storing in the database, it is about 3 times smaller, but stil too large. I finally manage to generate my own compact _javascript_ code to recreate the structure directly from client and it takes now about 2k, much more reasonable. Works fine. Thanks for the help. -- ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: [EMAIL PROTECTED] Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: CFWDDX converts to lower case?
CF will only lowercase keys, ie: cfset s = structNew() cfset s[Moo] = Zoo cfwddx action="" input=#s#toplevelvariable=root In this example, Moo gets lowercased, but Zoo does not. If you need to preserve the case you could simply modify your data a bit: cfset s = structNew() cfset s[Moo] = structNew() cfset s[Moo].data = ""> cfset s[Moo].origkey = Moo A bit of a hack but it will work. In CFMX, if you convert a query, the column names case will be preserved. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CFWDDX converts to lower case?
CF will only lowercase keys Ok, but what's the big idea? If the structure is to be exported from CF to JS, it does not really matter, but in my case the data comes from JS, is processed by CF and then return to JS. IF the keys have changed, the rest of the program simply does not recognizes them any more. For instance, I have simplified the structure I have to this: wddxPacket version='1.0'header/dataarray length='1'structvar name='tableLeft'number0/number/varvar name='tableRight'number1/number/var/struct/array/data/wddxPacket This is what is stored in the database, with JS variables tableLeft ans tableRight, but when the code is reconstructed with cfwddx action = "" here is what I get: _t1=new Array();_t1[0]=new Object();_t1[0][tableleft]=0;_t1[0][tableright]=1;myArray=_t1;_t0=null;_t1=null; Here the variables tableleft and tableright are lower cased. If I specify WDDX2J, I expect the case not to be changed, since JS is case sensitive. Is there any workaround? (beside using only lower case variables names in the JS program) -- ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: [EMAIL PROTECTED] Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: CFWDDX converts to lower case?
Workaround - sure - did you see my example of storing the key as another value? [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CFWDDX converts to lower case?
did you see my example of storing the key as another value? I did, but I just don't see how I can recreate the correct _javascript_ code out of this. In my case, the keys may be 2 or 3 levels deep in the _javascript_ structure. Furthermore, the WDDX is created from _javascript_, not from CF. -- ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: [EMAIL PROTECTED] Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: CFWDDX converts to lower case?
I guess your only option is to modify the original JS in the same way I suggest modifying the CF - i.e. modify your structure so you store an extra copy of the key - this way the case will be preserved. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CFWDDX converts to lower case?
I guess your only option This is was I was affraid of. However, I finally found simpler to modify the names used like tableLeft to table_left, so it is not affected by lowe case. Thanks. But still, I wonder why the developers of WDDX decided to use this lower case which nobody needs anyway? And worse, not documented this feature. -- ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: [EMAIL PROTECTED] Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
CFWDDX converts to lower case?
Hi, I'm trying to use CFWDDX in CF 5 to save _javascript_ data in a database and restore it back to _javascript_. First I discoverd that the _javascript_ function serialize() converts everything to lower case by default. Why? If I wanted to convert to lower case, I could do it myself. Then I saw in the code two undocumented properties: preserveVarCase and preserveFieldCase that must be set to true in order to prevent the conversion. I finally get the correct packets in my database. But now I see that when I convert back to _javascript_ through CFWDDX everything in converted again to lowercas. This is kind of ridiculous since _javascript_ is case sensitive. What's the big idea behind that? I cannot see the code inside CFWDDX and there seem to be no preserveCase attribute. Can someone help ? Thanks. ___ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]