开发者

ColdFusion & Ajax: Error Invoking CFC

I have tried multiple tutorials on this topic from Forta.com and yet run into the same error: "Error invoking CFC/....(file path)../wgn.cfc: Internal Server Error [Enable debugging by adding 'cfdebug to your URL parameters to see more info]"

I am working on my local machine and testing as localhost. Running WinXP Pro with sp3. Using Coldfusion's web server.

Both my .cfm and .cfc are in the same folder under the the webroot. In my case: c:\ColdFusion9\wwwroot\bridges(.cfm and .cfc here) So, they are in a "bridges" folder under wwwroot.

The code should generate some autosuggest functionality when the user types in the input box. Instead, it just spits back the above error.

This is my cfc named wgn.cfc:

<cfcomponent output="false">
    <cfset THIS.dsn="bridges">
      <!--- Lookup used for auto suggest --->
      <cffunction name="getWGN" access="remote" returntype="array">
        <cfargument name="search" type="any" required="false" default="">
        <!--- Define variables --->
        <cfset var data="">
        <cfset var result=ArrayNew(1)>
        <!--- Do search --->
        <cfquery datasource="#THIS.dsn#" name="data">
        SELECT tblIDs.ID
        FROM tblIDs
        WHERE (tblIDs.IDType = 'xxx') AND (tblIDs.ID Like ('#ARGUMENTS.search#%'));
        </cfquery>
        <!--- Build result array --->
        &开发者_如何学Clt;cfloop query="data">
        <cfset ArrayAppend(result, searchIDs)>
        </cfloop>
         <!--- And return it --->
        <cfreturn result>
       </cffunction>  
</cfcomponent>

And this is the relevant part of the form from my .cfm page:

    <cfform .....>
    <cfinput name="searchIDs" type="text" autosuggest="cfc:wgn.getWGN({cfautosuggestvalue})">
    //......more to form, obviously
    </cfform>


UPDATE Solution:

change
 <cfset ArrayAppend(result, searchIDs)>
to
 <cfset ArrayAppend(result, ID)>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜