Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
agwillia #1
WDDX and NULL values
I am currently working on a project to upgrade from our ColdFusion server from
CF 5.0 to CF MX 7. I've started testing our existing applications and have run
into a problem with using the WDDX serializer. In CF 5.0 when I used the
following code:
<script>
<cfwddx action="cfml2js" input="#application.userInfo#"
toplevelvariable="objUser">
</script>
...It would take my application query and turn it into JavaScript and handle
any null values in the query by making the JavaScript array value something
like _t2[90]="".
When I use the same code in CF MX 7 instead of getting "" in my JavaScript
array I get something to the effect of col[90=null. This is a big problem
because in our applications we populate a page using the values in the wddx
array and are expecting to get "" and not null. So now fields that should be
blank have the word null in them which messes up form validation and so forth.
We use this all over the place in over 80 applications so going through each
one of them and adding JavaScript like...if=null make ""...is not an option.
Is there any simple way to cause these null values to go back to showing up as
""?? I'm hoping there's maybe a solution through the CF administrator??
Thanks in advance for your help!
agwillia Guest
-
cfgridupdate and null values
Yeah I have the same problem. It looks like the only solution is to rewrite a custom version cfgridupdate to do my own custom query update. I... -
Please HELP! Problem with NULL values...
Hey everyone! I'm developing an asp/VBScrpti/Access web site and I'm having a little trouble with the record sets SQL. The site's deadline is... -
Null Values
hi how to count null values in an array? tnx -
Detecting Null Values
I have a DataGrid from which the datasource is a SqlDataReader based on a SQL Server Stored Procedure. This SP returns columns will NULL values. ... -
Null values enter to SQL
Hi, I have datagrid filled using SqlDataAdapter. One of the fields is a date field which can be null. When I assign null value I receive the... -
OldCFer #2
Re: WDDX and NULL values
You may be able to change this behavior in the wddx.js file. If you have the
one from
cf 5, you may be able to see the differences in the two in handling null
values.
Of course be sure you save a copy of the original wddx.js, and test the new
wddx handling
on a test machine. Good luck.
OldCFer Guest
-
agwillia #3
Re: WDDX and NULL values
I tried switching the wddx.js files but that didn't change anything, so its got
to be the tag itself. I actually ran into two additional problems when trying
to work with the tag in CF MX 7.
PROBLEM #1:
Unable to convert Oracle CLOB values to JavaScript using cfwddx or toScript()
tags.
Step 1: Use cfquery tag to query a CLOB value from an Oracle DB:
<cfquery name="testQuery " datasource="testDB">
SELECT TO_CHAR(clob_test) as clob_test FROM testTable
</cfquery>
Step 2: Use either the cfwddx tag (<cf_wddx action="cfml2js" input="testQuery"
toplevelvariable="objTest1"> ) or toScript() tag
(<script><cfoutput>#toScript(test, "objTest1")#</cfoutput></script> ) to
convert the query to JavaScript
Step 3: Run the page and look at the source code. Neither tag converted the
CLOB value to JavaScript. Instead of the JavaScript looking like this (which
is what I expect to see):
objTest1 = new WddxRecordset();
col0 = new Array();
col0[0] = "CLOB Value"
objTest1["clob_test"] = col0;
col0 = null;
I get this instead:
objTest1 = new WddxRecordset();
col0 = new Array();
col0[0] = objTest1["clob_test"] = col0;
col0 = null;
PROBLEM #2:
In attempts to fix Problem #1 I tried putting a TO_CHAR() around my clob.
This is a valid query and I can run it Oracle fine but when I try in a cfquery
tag it is unable to resolve the page.
Step 1:
Write cfquery:
<cfquery name="testQuery " datasource="testDB">
SELECT TO_CHAR(clob_test) as clob_test FROM testTable
</cfquery>
Step 2:
Run the page in the browser but the page will never resolve
Hopefully someone has a solution to one of these problems because there's no
way I'm going to be able to upgrade our CF server to MX 7 until I can find some
way to get something that will work like the <cfwddx> tag did in CF 5.
agwillia Guest



Reply With Quote

