Ummm, what about a public getter? Or am i missing something?
<cffunction name="getMyProperty" access="public" returntype="string"
output="false">
<cfreturn variables.getMyProperty />
</cffunction>
<cffunction name="setMyProperty" access="public" returntype="VOID"
output="false">
<cfargument name="myProperty" type="string" required="true" />
<cfset variables.myProperty = arguments.myProperty />
</cffunction>
<cfset myProperty = myObj.getMyProperty() />
store the object in session or application scope if the properties should
persist, but if you do, make sure to var scope any variables used in the
functions that you use to manipulate values.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Daniel Short
Sent: Wednesday, November 10, 2004 6:52 AM
To: [EMAIL PROTECTED]
Subject: [CFCDev] How to define a property on a CFC
Hi everyone,
I'm trying to figure out how to set a property on a CFC and reference it on
my calling page. In VBScript I can define as many properties as I'd like and
reference them via objName.PropertyName. I'm assuming that's possible with
local CFCs (I'm not intersted in web services at all on this one), but the
livedocs suggest that cfproperty is webservice specific. I'm not finding any
other method to make this happen beyond using the THIS scope. My vague
knowledge of the THIS scope is that this scope is available (and
overwritable, manipulatable) in the calling page, which isn't what I'm
after. I need a read-only property that can only be manipulated from inside
the CFC.
I have a feeling that I'm missing something really simple here, but I just
can't get it.
Dan
----------------------------------------------------------
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
[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
[EMAIL PROTECTED]