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