You're not specifying a full type.  "cfc.ces.DBData" is different than
"DBData".  The latter is a file in the same directory as the 'cfc'
directory listed in the former:

Here's an illustration

/
+-cfc/
    +-ces
       +DBData.cfc (type of component)
+-DBData.cfc (what your function wants)

If you change your init method to expect "cfc.ces.DBData" it should work.

cheers,
barneyb

On Mon, 13 Sep 2004 15:06:56 -0500, Deanna Schneider
<[EMAIL PROTECTED]> wrote:
> 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
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to