I didn't gather that you also cannot invoke methods of persistently scoped
components via form or url.
Not directly you can't. You could invoke persistently scoped objects from
within the transitional one created when called from the form, with some
caveats.
I doubt many would consider this
Well, it seems to me that both forms are being handled by a new instance of
temp. update1 stores the value in that new instance, which is garbage
collected some time after the POST request terminates. update2 stores the
value in the prexisting instance which has been placed in the session scope,
Because you're posting to temp.cfc directly, not the temp.cfc you've loaded
into the session scope.
Rick
On 3/8/07, joe smiths [EMAIL PROTECTED] wrote:
Given the files below - why does update1() fail to update the cfc
property?
file TEMP.CFM:
cfoutput
cfif not isDefined(session.temp)
Because you're posting to temp.cfc directly, not the temp.cfc you've loaded
into the session scope.
Could you expand on that?
How would one post to the session scoped temp.cfc via a form?
~|
Macromedia ColdFusion MX7
Upgrade
Because you're posting to temp.cfc directly, not the temp.cfc you've loaded
into the session scope.
How would one post to the session scoped temp.cfc via a form?
~|
Deploy Web Applications Quickly across the enterprise with
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.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
Fig Leaf Software provides the highest caliber
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
Because you're posting to temp.cfc directly, not the temp.cfc you've loaded
into the session scope.
When the cfm is loaded, a session scoped component is instantiated. When the
update2 form is submitted, the session scoped component property tableName is
updated as expected. The odd part (to me
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.
It can be done that way. What you are not realizing is that when you post
directly to the CFC url by the
PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
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
Essentially, you should *NOT* ever post to a cfc.
What you do is post the page to itself (or another cfm) and then pass the
arguments to the method like so:
cfset results = session.temp.myMethod(arg1,arg2...)
Rick
~|
Essentially, you should *NOT* ever post to a cfc.
But I like posting to my cfc's sometimes. I just understand I am creating
one-off controller type cfcs when I do this.
--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
-
| 1 | |
-
Isn't web services all about posting to CFC's? Am I missing something here?
Russ
-Original Message-
From: Ian Skinner [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 08, 2007 5:32 PM
To: CF-Talk
Subject: RE: CFCs and the THIS scope
Essentially, you should *NOT* ever post
On 3/8/07, Russ [EMAIL PROTECTED] wrote:
Isn't web services all about posting to CFC's? Am I missing something
here?
If you think that's the same thing, then yes, you are =)
--
I'm not certified, but I have been told that I'm certifiable...
Visit http://www.opensourcecf.com today!
...What you are not realizing is that when you
post directly to the CFC url by the action property of the form tag,
you are creating a new instance of the object...
Bingo. That was indeed my problem. In the docs it is written that you may only
transiently invoke component methods via form
15 matches
Mail list logo