What usually causes this error?
I have a bean Query.cfc, named of course Query..
When I init the bean I get the following error message...
The value returned from function init() is not of type Query. If the
component name is specified as a return type, the reason for this
error might be that a definition file for such component cannot be
found or is not accessible. <br>The error occurred on line 2.
I've compared it to another bean and they're almost identical (aside
from name, variables, etc)..
The init() function looks like
<cfcomponent name="Query" hint = "I am the Query Bean" output="false" >
<cfset variables.instance.query_id = 0 />
<cfset variables.instance.query_name = "" />
<cfset variables.instance.descr = "" />
<cffunction name="init" displayname="init" hint="Bean for CF_Query"
access="public" output="false" returntype="Query">
<cfargument name="Query_id" type="numeric" required="false"
default="0" hint="QUERY_ID" />
<cfargument name="Query_name" type="string" required="false"
default="" hint="QUERY_NAME" />
<cfargument name="Descr" type="string" required="false" default=""
hint="DESCR" />
<cfset variables.instance = structNew() />
<cfset setQuery_id(arguments.Query_id) />
<cfset setQuery_name(arguments.Query_name) />
<cfset setDescr(arguments.Descr) />
<cfreturn this />
</cffunction>
....
....
and I'm testing it like....
<cfset query = createObject("component", "com.queries.Query").init(
QUERY_ID = 1 ) />
<cfoutput>
Query_id = #query.getQuery_id#<br />
</cfoutput>
I expect no pizazz but
Query_id = 1
but that's not even working..
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:300523
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4