bulldozer
10-30-2005, 06:04 PM
This is killing me. I know I'm connecting to the service, because I'm getting error messages back when I don't pass the right parameters. How do I access the data when it comes back from the CFC?!?!?!?! trace comes back as:
onResult : [object Object]
undefined
AS CODE
var ncFlashRemoting:NetConnection = new NetConnection();
ncFlashRemoting.connect("http://www.berings.com/flashservices/gateway");
function Result()
{
this.onResult = function(result)
{
trace("onResult : " + result);
trace(result.getItemAt(1).REG_ID);
}
this.onStatus = function(error)
{
trace("onStatus called : " + error.description);
}
}
var myArguments = {}; //or new Object();
myArguments.search = "%SMITH%";
myArguments.type = false;
myArguments.page = 1;
myArguments.records = 5;
ncFlashRemoting.call("registrySearch.getData", new Result(), myArguments);
CFC CODE
<cfcomponent>
<cffunction name="getData" access="remote" returntype="query">
<cfargument name="search" type="string" required="Yes">
<cfargument name="type" type="boolean" required="Yes">
<cfargument name="page" type="numeric" required="No" default="1">
<cfargument name="records" type="numeric" required="No" default="20">
<cfstoredproc datasource="#application.datasource#" procedure="sp_BrideSearch">
<cfprocparam cfsqltype="CF_SQL_VARCHAR" dbvarname="search" value="#arguments.search#" type="In">
<cfprocparam cfsqltype="CF_SQL_BIT" dbvarname="type" value="#arguments.type#" type="In">
<cfprocparam cfsqltype="CF_SQL_INTEGER" dbvarname="page" value="#arguments.page#" type="In">
<cfprocparam cfsqltype="CF_SQL_INTEGER" dbvarname="RecsPerPage" value="#arguments.records#" type="In">
<cfprocresult name="result">
</cfstoredproc>
<cfreturn result>
</cffunction>
</cfcomponent>
THANKS!!!!
onResult : [object Object]
undefined
AS CODE
var ncFlashRemoting:NetConnection = new NetConnection();
ncFlashRemoting.connect("http://www.berings.com/flashservices/gateway");
function Result()
{
this.onResult = function(result)
{
trace("onResult : " + result);
trace(result.getItemAt(1).REG_ID);
}
this.onStatus = function(error)
{
trace("onStatus called : " + error.description);
}
}
var myArguments = {}; //or new Object();
myArguments.search = "%SMITH%";
myArguments.type = false;
myArguments.page = 1;
myArguments.records = 5;
ncFlashRemoting.call("registrySearch.getData", new Result(), myArguments);
CFC CODE
<cfcomponent>
<cffunction name="getData" access="remote" returntype="query">
<cfargument name="search" type="string" required="Yes">
<cfargument name="type" type="boolean" required="Yes">
<cfargument name="page" type="numeric" required="No" default="1">
<cfargument name="records" type="numeric" required="No" default="20">
<cfstoredproc datasource="#application.datasource#" procedure="sp_BrideSearch">
<cfprocparam cfsqltype="CF_SQL_VARCHAR" dbvarname="search" value="#arguments.search#" type="In">
<cfprocparam cfsqltype="CF_SQL_BIT" dbvarname="type" value="#arguments.type#" type="In">
<cfprocparam cfsqltype="CF_SQL_INTEGER" dbvarname="page" value="#arguments.page#" type="In">
<cfprocparam cfsqltype="CF_SQL_INTEGER" dbvarname="RecsPerPage" value="#arguments.records#" type="In">
<cfprocresult name="result">
</cfstoredproc>
<cfreturn result>
</cffunction>
</cfcomponent>
THANKS!!!!