Hmmm, i just figured out that the variables scope isn't available to child components. Ok, there's my answer.
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Nando > Sent: Thursday, October 30, 2003 12:08 AM > To: [EMAIL PROTECTED] > Subject: [CFCDev] accessing an obj instantiated within a parent > > > I'm attempting to instantiate a component in the init() method of a base > component so it will be available to the child components, like so: > > <cfcomponent displayname="Content" hint="I am a unit or block of content"> > > <cffunction name="init" access="public" returntype="Content"> > .... > <cfset variables.display = > createObject('component','Display') /> > <cfreturn this /> > </cffunction> > > variables.display shows up in the dump for the content object > with all it's > methods intact - so far so good. But when i try and access a method within > variables.display from a child component as below, i get an error: > > <cfcomponent extends="Content" displayname="Text" hint="I am a unit of > text"> > > <cffunction name="getContent" access="public"> > .... > <cfset myText = > variables.display.text(arguments.thisText) /> > .... > Element DISPLAY is undefined in a Java object of type class > [Ljava.lang.String; referenced as > > If i instantiate Display in the child component of Content, it works fine. > > Should i be able to do this? How? > > > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.com). > > An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
