I'm sure I'll kick myself shortly, but after spending two weeks trying
and failing to write a cross-browser javascript webservice consumption
class and then a week on vacation in Mexico, apparently my simple CFC
skills have left me entirely. This problem has to do with the
inheritance chain and the unnamed scope. Here's a mockup of the code
I've got.

<-- base.cfc --->
<cfcomponent>
   <cfset _hidden = "" />
   <cffunction name="read" returntype="struct">
      <cfif IsSimpleValue(_hidden)>
         <cfset setValue() />
      </cfif>
      <cfreturn _hidden />
   </cffunction>
</cfcomponent>

<-- child.cfc -->
<cfcomponent extends="base">
   <cffunction name="setValue" returntype="base">
      <cfset _hidden = StructNew() />
      <cfset _hidden.key1 = "value1" />
      <cfreturn this />
   </cffunction>
</cfcomponent>

When I invoke child.cfc and try the read() method, I get an error that
says _hidden is not defined, thrown in the IsSimpleValue() check.

Why? I've defined no arguments so that collision isn't possible, and I'm
just trying to use the unnamed scope - note that in a prior version of
similar functionality, when all of this is in one cfc, there's no error
whatsoever. 

Other components I've written use an "instance" structure in the unnamed
scope, and work just fine. What could possibly be wrong with this code?

-- 
Eric C. Davis
Programmer/Analyst II
Georgia Department of Transportation
Office of I.T. Applications
Web Applications Group
404.463.2860.199
[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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]

Reply via email to