>Have to admit I find it shocking that a THIS scoped variable cannot be
>updated within the enclosing component by >using a simple assignment
>statement...
That would be shocking, but it's not the problem you're having.
Suffice to say that generally speaking, you don't want to post directly to a
cfc. The idea is to post to an action page like dostuff.cfm, and then in
that action page, do what you want with your objects (instantiate, call
methods, etc.)
In your action page dostuff.cfm you might have:
<cfset tempObj = createObject("component","temp")> <!--- instantiate
instance of object --->
Then to pass your form variable in,
<cfset tempObj.update1(form.tableName)> <!--- set property tableName in
instance to form value --->
Then you should get the desired result:
#tempObj.tableName# should return whatever you passed in above.
Of course since your object is not in the above case scoped into the
session, it would only be available for the duration of the request.
I won't even get into whether it's ok to use the THIS scope or not. That is
one of the most contentious issues when it comes to objects and CF.
-- Josh
----- Original Message -----
From: "joe smiths" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Thursday, March 08, 2007 12:27 PM
Subject: Re: CFCs and the THIS scope
> Wow. Well then, since this.tableName=arguments.tableName will simply never
> work as intended (as in the update1 method) I will stick to
> session.temp.tableName=arguments.tableName (as in the update2 method).
> Have to admit I find it shocking that a THIS scoped variable cannot be
> updated within the enclosing component by using a simple assignment
> statement...
>
> Thanks to all for your replies.
>
>>> How would one post to the session scoped temp.cfc via a form?
>>
>>You couldn't, directly. You would have to post to another page, which
>>could
>>send data to your session object.
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7.
Free Trial. http://www.adobe.com/products/coldfusion
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272076
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4