On Tuesday, September 3, 2002, at 06:09 PM, Dave Watts wrote:

>> Question: Any trick to getting cfproperty to define and
>> persist a variable (in 'this') with flash remoting?
>>
>> I have:
>> <cfproperty hint="It's bigger than a bread-box"
>> name="LastError" type="string" default="">
>
> The CFPROPERTY tag is a bit confusing. I think it's used to define 
> metadata,
> rather than what you'd think of as properties of an object. So, 
> basically,
> for your purposes it does nothing useful.
>
> To create publicly-accessible "properties", just declare variables 
> within
> your CFCOMPONENT body, before your CFFUNCTION tags, using the scope 
> "this".
> At least, I think this is how it works - it's a bit confusing, and I'm 
> a bit
> woozy. Matt or Sean can correct me if I'm wrong.
>
> In general, though, you might want to avoid the creation of
> publicly-accessible variables, and create "methods" using CFFUNCTION
> instead, to manipulate internal variables. You might also want to check 
> the
> list archives for the "CFC theory" thread which was running a couple of 
> days
> ago.
>
>


Ah! ... OK, so I use cfset then... I did intend to manage a ('private') 
property with set and get methods as you suggested...

My tests of using cfset in the 'this' scope have failed to get 
persistence btween calls to remote methods. For example, I 1) 
initilialize this.lasterror before any function tag 'declarations', 2) 
change the value in one method, which also puts the proof into cflog, 3) 
then call another method (using the same line of code).... blotto! The 
value gets re-initialized just b4 the second method call...

I just read Forta's latest article on CFC's CF Dev Journal and it leads 
me to b'leave that the only way to persist variables btwn method calls 
is to store the object in a scope that the CF architecture already 
defines as persistent, like session or client or application. So you use 
<cfobject component="" ...> syntax then attach it to client or something.

Thanks for the response... I'll briefly summarize the results of my 
suffering later...hook or crook


Jon Gorrono (Gorro&ntilde;o)            [EMAIL PROTECTED]
Programmer                              1400-M Surge II
Mediaworks                              UC Davis
A Department of IET                     Davis, CA   95616
University of California at Davis       (530)752-0218;FAX-4655
Alerts: [EMAIL PROTECTED]       CELL/PAGE:(530)219-1624
Owner:Digital Video Discussion List  -> [EMAIL PROTECTED]

______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to