|
Hi eric The problem you have is that you seem to
be using cfproperty as a way in instantiating your variable in the unnamed
scope. This is not however how cfproperty works. Cfproperty is acutally
Meta-data for the component, not instance data of the component. This also
means that it is not unique between instances of the same component. What you need to do is use the implicit
constructor code of cfc's to instantiate your
variable. A good idea for variables in unamed scope is to use the underscore _
character so u set them apart from other variables. Sample code below. Pat <cfcomponent output="no"> <cfscript> _aProperty = "";
//I think you could also use cfparam </cfscript>
</cfcomponent> -----Original
Message----- Greetings, all. As my organization has yet to install the 6.1 update,
I am unable to take advantage of the variables-scope-like-use inside any CFCs.
Once I can, my problem may be resolved; unfortunately, I can't wait that long
to know. The issue: I've got several components, each outlining
their properties with the cfproperty tag, and each possessing an init() method
wherein I pass a datasource collection and create the internal variables with
any defaults. Example: No problem, right? I invoke all of my CFCs with the
CreateObject() function, then init() their variables, passing the DSN structure
if the component is to access the database. I have yet to have a problem with
this. When I add another method, it doesn't seem to be able
to see the value of the properties set by the init() function. This returns to my invoking template the following
value: "The value returned from function getAProperty()
is not of type array." Is the only way to maintain semi-private variables in
the unnamed scope by creating them in the "constructor area" between
property and function definitions? Please help. You've taught me so much and I have so
much more to learn. Thanks, |
Title: Persistence of unnamed-scope
- RE: [CFCDev] Persistence of unnamed-scope Davis, Eric
- Re: [CFCDev] Persistence of unnamed-scope Sean A Corfield
- RE: [CFCDev] Persistence of unnamed-scope Suyer, Ed [PRD Non-J&J]
- [CFCDev] developing a cold fusion app... Camilo Trevino
- RE: [CFCDev] Persistence of unnamed-scope Patrick Branley
- RE: [CFCDev] Persistence of unnamed-scope Davis, Eric
- [CFCDev] Persistence of unnamed-scope Davis, Eric
- RE: [CFCDev] Persistence of unnamed-scope Davis, Eric
- Re: [CFCDev] Persistence of unnamed-s... Sean A Corfield
- RE: [CFCDev] Persistence of unnamed-s... Chris Kief
