Hi,
please help, i can't figure out
The variables.compID is numeric but with this code below, i have an error: "the CompID argument passed to the getItem function is not type numeric". I then change it to
<cfargument name="compID" type="any" required="yes" > for testing and then got the diffrent error: The Element compID is undefined in arguments
Can any one tell me why? thanks
<!---cfm--->
<cfset variables.compID = request.state.compID />
<cfinput type="text" name="name" size="30" id="name" value="" autosuggest="cfc:cfc.query.getItem({cfautosuggestvalue},{variables.co mpID})"/>
<!---cfc--->
<cffunction name="getItem" access="remote" returntype="Array" >
<cfargument name="search" type="any" required="false"/>
<cfargument name="compID" type="numeric" required="yes" >
<cfdump var="#arguments.compID#" >
<!--- Define variables --->
<cfset var qItem="">
<cfset var result = "">
<!--- Do search --->
<cfquery name="qName" datasource="#dsn#" >
select name, id from mytbl#arguments.compID#
WHERE name LIKE lower('#ARGUMENTS.search#%')
ORDER BY name
</cfquery>
<!--- Build result array --->
<cfloop query="qName">
<cfset ArrayAppend(result, name)>
</cfloop>
<cfreturn result>
</cffunction>