CF and Flex Unexpected data type change

Ask a Question related to Coldfusion Flash Integration, Design and Development.

  1. #1

    Default CF and Flex Unexpected data type change

    My apologies in advance for a long post.

    I have a Flex application that talks to either a SQL Server or Oracle database
    through ColdFusion. One screen has a datagrid which is bound to a query
    returned by a function contained in a cfc. A number of the columns are
    integers to be used as flags (0 or -1), and there are checkboxes on the screen
    bound to these columns. When I call the function with a connection to SQL
    Server, I receive the data in Flex with the data type I expect - string for
    descriptive fields, and int for the integers. When I call the same function
    with a connection to an Oracle database, all of the data is of type string.
    Yes, I have confirmed that the table is defined correctly in the Oracle
    database. Also, dumping the metadata of the query from CF shows that the
    numeric fields are numeric, and the string fields are string; however,
    examining the ResultEvent.result in the handler shows that all of the values
    have been sent back to Flex as strings (performing the same check in SQL Server
    reveals that the fields are of the expected data type). The end result is that
    the checkboxes always appear to be checked when connected to Oracle, but the
    checkboxes follow the data when connected to SQL Server.

    Has anyone else seen anything like this? Am I missing something painfully
    obvious?

    Thanks in advance,

    Leighton

    <cffunction name="GetUsers" returntype="query">
    <CFQUERY name="qry" datasource="#connection_string#">
    SELECT 0 AS BNEW, USERID, USERNAME, USERPASSWORD, USERADMIN, USERINACTIVE,
    LNAME, FNAME, SHORT_NAME, BADGE_NUMBER, EXTERNAL_ID, MOBILE_USER,
    USER_GROUP_ID
    FROM TBLUSER
    ORDER BY USERNAME
    </CFQUERY>
    <cfreturn qry>
    </cffunction>
    <!--- BNEW, USERID, USERADMIN, USERINACTIVE, MOBILE_USER, and USER_GROUP_ID
    are all defined as integer; the remainder are strings --->

    MarsupialsDo Guest

  2. Similar Questions and Discussions

    1. flex chart data change events
      I need to capture an event for when the data is updated in a chart. I take a snapshot of the chart and save it to a file. But when I do it via a...
    2. Converting from data type varchar to data type money
      Hi all, Tearing my hair out trying to figure this out. If anyone can provide any help i would greatly appreciate it. When I try to do an insert...
    3. Converting data type varchar to data type money
      Hi all, Tearing my hair out trying to figure this out. If anyone can provide any help i would greatly appreciate it. When I try to do an insert...
    4. #26304 [Opn->Asn]: Unexpected data loss when opening dba file
      ID: 26304 Updated by: iliaa@php.net Reported By: vesely at tana dot it -Status: Open +Status: ...
    5. #26304 [NEW]: Unexpected data loss when opening dba file
      From: vesely at tana dot it Operating system: Solaris PHP version: 4.3.4 PHP Bug Type: DBM/DBA related Bug description: ...
  3. #2

    Default Re: CF and Flex Unexpected data type change

    Still don't know why it is doing what it's doing, but I have a workaround for
    anyone experiencing the same kind of thing.
    I have changed the selected property of my check boxes to perform an explicit
    coercion of the type to Boolean as follows.

    Before:
    selected="{lstPermitType.selectedItem.AUTO_ISSUE_T EMP}"

    After:
    selected="{Boolean(int(lstPermitType.selectedItem. AUTO_ISSUE_TEMP))}"

    This allows the check boxes to properly display the expected value based on
    the item selected in the list rather than always displaying a check (even when
    the value is "0").

    MarsupialsDo 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