Okay, so I'm working on my first app that really makes use of components,
and I _thought_ it was perfectly acceptable to say that a function expects
an argument, the type of which is another object. So, for example, I have a
dbData object, I should be able to do this:

application.dbdata = createObject("component", "cfc.ces.DBData").init();

And, then, if I have the following code in another init function:
<cffunction access="public" name="init" returntype="Survey" output="false"
hint="Initializes the object, setting the data access parameters.">
<cfargument name="dbdata" required="true" type="DBData">
<cfset variables.dbdata = arguments.DBData>
<cfreturn this />
</cffunction>

I should be able to do this:
session.thisSurvey = createObject("component",
"ces.apps.360Review.cfc.survey").init(application.dbdata);

However, I get an error saying that the dbdata argument is not of type
dbdata. If I say it can accept any type, it initializes just fine. And then
I can use the dbdata object just like I'd expect to be able to in the survey
componenet:
For example, this code in the survey object:
datasource="#variables.dbdata.getDSN()#"
works just fine.

Am I crazy? What am I missing?

--
Deanna Schneider
UWEX-Cooperative Extension
Interactive Media Developer
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to