在Cold Fusion中使用基于AJAX的三链/相关选择
我收到错误调用CFC:内部服务器错误添加cfdebug标记无效
Triple Chained / Related Select工作正常,但会生成错误。我怎样才能阻止它发生。我相信我的CFC编码正确
任何帮助将不胜感激
已经尝试使用bindonload = false进行第二次选择无效也尝试使用bindonload = false进行首选选项不加载
这是我的代码
CFC:
<!--- Get array of media types --->
<cffunction name="getDevice" access="remote" returnType="array">
<!--- Define variables --->
<cfset var data="">
<cfset var result=ArrayNew(2)>
<cfset var i=0>
<!--- Get data --->
<cfquery name="data" datasource="#dsn#">
SELECT device_id, device_list
FROM pa_device
ORDER BY device_list
</cfquery>
<!--- Convert results to array --->
<cfloop index="i" from="1" to="#data.RecordCount#">
<cfset result[i][1]=data.device_id[i]>
<cfset result[i][2]=data.device_list[i]>
</cfloop>
<!--- And return it --->
<cfreturn result>
</cffunction>
<!--- Get art by media type --->
<cffunction name="getProblem" access="remote" returnType="array">
<cfargument name="device_id" type="numeric" required="true">
<!--- Define variables --->
<cfset var data="">
<cfset var result=ArrayNew(2)>
<cfset var i=0>
<!--- Get data --->
<cfquery name="data" datasource="#dsn#">
SELECT problem_id, problem_list
FROM pa_problem
WHERE device_id = #ARGUMENTS.device_id#
ORDER BY problem_list
</cfquery>
<!--- Convert results to array --->
<cfloop index="i" from="1" to="#data.RecordCount#">
<cfset result[i][1]=data.problem_id[i]>
<cfset result[i][2]=data.problem_list[i]>
</cfloop>
<!--- And return it --->
<cfreturn result>
</cffunction>
<!--- Get art by media type --->
<cffunction name="getdescription" access="remote" returnType="array">
<cfargument name="device_id" type="numeric" required="true">
<cfargument name="problem_id" type="numeric" required="true">
<!--- Define variables --->
<cfset var data="">
<cfset var result=ArrayNew(2)>
<cfset var i=0>
<!--- Get data --->
<cfquery name="data" datasource="#dsn#">
SELECT description_id, description_list, device_id
FROM pa_description
WHERE device_id = #ARGUMENTS.device_id# and problem_id =#arguments.problem_id#
ORDER BY description_list
</cfquery>
<!--- Convert results to array --->
<cfloop index="i" from="1" to="#data.RecordCount#">
<cfset result[i][1]=data.description_id[i]>
<cfset result[i][2]=data.description_list[i]>
</cfloop>
<!--- And return it --->
<cfreturn result>
</cffunction>
CFM
<cfform>
<table>
<tr>
<td>Select Device Type:</td>
<td><cfselect name="device"
bind="cfc:art.getDevice()"
bindonload="true" /></td>
</tr>
<tr>
<td>Select Problem Type:</td>
<td><cfselect name="problem"
bind="cfc:art.getProblem({device})"
bindonload="false" /></td>
</tr>
<tr>
<td>Select Description Type:</td>
<td><cfselect name="description"
bind="cfc:art.getdescription({device},{problem})"
bindonload="false"/></td>
</tr>
</table>