School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,365 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,434 people online right now. Registration is fast and FREE... Join Now!




CF AJAX binding error

 

CF AJAX binding error, Binding radio buttons to drop down menu

xheartonfire43x

11 Jun, 2009 - 05:30 AM
Post #1

D.I.C Regular
***

Joined: 22 Dec, 2008
Posts: 260



Thanked: 2 times
My Contributions
I am using CF AJAX to do form binding and I have a form field bound to a CFC.

incl_pricing_var.cfm
CODE

<cfform>
<cfoutput>
<!---Pricing Area START--->
<table width="100%" border="0" cellpadding="0"  bgcolor="##FFFFFF">
    <tr>
        <td>  
            <cfif get_pricing.recordcount gt 1>
                <table width="100%" cellpadding="0" cellspacing="0">
                    <cfloop query="get_pricing">
                        <tr>
                            <Td height="25" width="15">
                                <input type="radio" id="sku_suffix" name="sku_suffix" value="#get_pricing.sku_suffix#" <cfif get_Pricing.sortorder EQ 1>checked</cfif>>
                            </td>
                            <td class="pricing" style="padding-left:5px; padding-right:5px; ">
                                $#get_Pricing.price# #get_pricing.description#
                            </Td>                        
                        </tr>
                    </cfloop>
                    <Tr>
                        <td colspan="2" ><hr size="1" noshade></td>
                    </Tr>
                </table>
            <cfelse>
                <cfinput type="hidden" id="sku_suffix" value="#get_pricing.sku_suffix#" name="sku_suffix" >
            </cfif>
        </td>
    </tr>
<!---Pricing Area END--->

<!---Variations Area START--->
    <tr>
      <td>
      <cfselect name="variation" bind="cfc:bind_getvariations.getvariations(sku=#get_skus.sku#,sku_suffix={sku_suffix})" display="variationvalue" value="sku_suffix"></cfselect>
  </tr>
<!---Variations Area END--->
</table>
</cfoutput>
</cfform>


bind_getvariations.cfc
CODE

<cfcomponent>

    <cfscript>
        mydatasource = "pgd";
        myusername = "root";
        mypassword = "ibotix$6416";
    </cfscript>

    <cffunction name="getVariations" access="remote" returntype="string" output="yes">
        <cfargument name="sku_suffix" type="string" required="yes">
    <cfargument name="sku" type="string" required="yes">
    
    <CFQUERY name="getvariationvalues" datasource="#mydatasource#" username="#myusername#" password="#mypassword#">
      Select variations.sku_suffix AS sku_suffix,variationvalues.variationvalue AS variationvalue
      FROM variations,variationvalues,groupvariations
      WHERE variations.sku = <cfqueryparam value="#ARGUMENTS.sku#">
        AND variations.sku_suffix = <cfqueryparam value="#ARGUMENTS.sku_suffix#">
        AND variations.groupvariationid = groupvariations.id
        AND variationvalues.variationid = groupvariations.id
        </CFQUERY>

    <cfset variationvalues = #SERIALIZEJSON(getVariationValues)#>
    <cfreturn variationvalues />
    </cffunction>
</cfcomponent>


I get a JavaScript error saying "exception thrown and not caught"... sounds like the browser is really bad at playing catch...

Anyone see my error, because I don't?

Edit:
I fixed the exception thrown and not caught error but now have a new one. The Solution to "exception thrown and not caught" turned out to be that I had HTML comment tags in my application.cfm file.

My new problem is that the CFDebug window is telling me that the function is not returning a 2d array or valid serialized query.

Full Error Details:
QUOTE

error:bind: Bind failed for select box variation, bind value is not a 2D array or valid serialized query

info:http: CFC invocation response: "{\"COLUMNS\":[\"SKU_SUFFIX\",\"VARIATIONVALUE\"],\"DATA\":[]}"

info:http: HTTP GET /Components/bind_getvariations.cfc?method=getvariations&returnFormat=json&argumentCollection=%7B%22sku_suffix%22%3A79804%2C%22sku%22%3A%22X14%22%7D&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=6BAF55E8D78AB4F2AC7408A7DB086AA0&_cf_rc=2

info:http: Invoking CFC: /Components/bind_getvariations.cfc , function: getvariations , arguments: {"sku_suffix":79804,"sku":"X14"}

error:bind: Bind failed for select box variation, bind value is not a 2D array or valid serialized query

info:http: CFC invocation response: "{\"COLUMNS\":[\"SKU_SUFFIX\",\"VARIATIONVALUE\"],\"DATA\":[]}"

info:http: HTTP GET /Components/bind_getvariations.cfc?method=getvariations&returnFormat=json&argumentCollection=%7B%22sku_suffix%22%3A79804%2C%22sku%22%3A%22X12%22%7D&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=6BAF55E8D78AB4F2AC7408A7DB086AA0&_cf_rc=1

info:http: Invoking CFC: /Components/bind_getvariations.cfc , function: getvariations , arguments: {"sku_suffix":79804,"sku":"X12"}

error:bind: Bind failed for select box variation, bind value is not a 2D array or valid serialized query

info:http: CFC invocation response: "{\"COLUMNS\":[\"SKU_SUFFIX\",\"VARIATIONVALUE\"],\"DATA\":[]}"

info:http: HTTP GET /Components/bind_getvariations.cfc?method=getvariations&returnFormat=json&argumentCollection=%7B%22sku_suffix%22%3A79804%2C%22sku%22%3A%22S%22%7D&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=6BAF55E8D78AB4F2AC7408A7DB086AA0&_cf_rc=0

info:http: Invoking CFC: /Components/bind_getvariations.cfc , function: getvariations , arguments: {"sku_suffix":79804,"sku":"S"}

info:LogReader: LogReader initialized

info:global: Logger initialized


This post has been edited by xheartonfire43x: 11 Jun, 2009 - 07:30 AM

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 08:44PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month