WDDX and NULL values

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. Null Values
      hi how to count null values in an array? tnx
    4. 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. ...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139