0

我有一个 ColdFusion 11 组件,它应该使用绑定填充 cfselect。但是,选择根本没有填充值。它显示空白。这些是我想要相互关联的 2 个选择表单控件。从一个中选择应该使用基于所做选择的值填充另一个。

<td>
From IJ: 
						
<cfselect name="im" 
	id="im"
	bind="cfc:BTransfer.Get_Alls()"
	display="strTName"
	value="city_code"
	queryposition="below"
	bindonload="true">
	<option value="">Select ...</option>
</cfselect>
</td>			
					
<td>	
To IJ:					
<cfselect
    name="toij"
    id="toij"
	bind="cfc:BTransfer.Get_Ts({city_code})"
	value="strTCode"
	display="strTName"
	queryposition="below">
	<option value="">Select ...</option>
</cfselect>
</td>

[b]The component.[/b]

<cfcomponent output="false">

	 <cffunction name="Get_Alls" access="remote" output="false" returntype="Query">

	 	<cfset var qry_getall = "">

	 	<CFQUERY NAME="qry_getall" DATASOURCE="#dsn#" cachedWithin="#CreateTimeSpan(1,0,0,0)#" >
			SELECT	 T_Code AS strTCode,
			ltrim(t_name) AS strTName,
			 city_code
			FROM	 tblLookupTCity
			WHERE	 blnactive = 1
			ORDER BY T_name
		</CFQUERY>
	  <cfreturn qry_getall />
		
	 </cffunction>

	  <cffunction name="Get_Ts" access="remote" output="false" returntype="Query">

		<cfset var qry_getall = "">

		<cfargument name="city_code" type="numeric" required="true" >
		
	 	<CFQUERY NAME="qry_getall" DATASOURCE="#dsn#" cachedWithin="#CreateTimeSpan(1,0,0,0)#" >
				SELECT	 T_Code AS strTCode,
				trim(T_name) AS strTName,
				city_code
				FROM	 tblLookupTCity
				WHERE	 CITY_CODE = '#arguments.city_code#'
				  AND	 blnactive = 1
				ORDER BY T_name
			</CFQUERY>

	  <cfreturn qry_getall />

	 </cffunction>

</cfcomponent>

4

0 回答 0