can you set a request scope variable in an include?
ex.
-index.cfm
--include1.cfm -- set request.test
--include2.cfm -- read request.test
can this be done?
--
--
Ian Sheridan
http://www.savagevines.com
--
Sure, as long as you set it before you call it of course
-Original Message-
From: Ian Sheridan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 03, 2004 12:38 PM
To: CF-Talk
Subject: How to use Request scope?!
can you set a request scope variable in an include?
ex.
-index.cfm
-Original Message-
From: Ian Sheridan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 03, 2004 12:38 PM
To: CF-Talk
Subject: How to use Request scope?!
can you set a request scope variable in an include?
ex.
-index.cfm
--include1.cfm -- set request.test
--include2
It sounds like it wasn't always being set in the first include.
Regardless of what file a request variable is set in, it is available to
all subsequent code. I may be off a bit with regard to CFCs, but that's
how I understand it.
--Ben
Ian Sheridan wrote:
well that's the thing I am setting
Well let me be a little bit more descriptive.
I have an index.cfm page that includes two files. I was then setting
the REQUEST variable *in* the first include. In the second include I
would then look for it. This did not work.
I now set the REQUEST variable in the index.cfm file first. Then set
Except that I do exactly what you said didn't work all the time. I
routinely create request or variable scoped vars in one include to be
used in another. The includes are serial, not nested.
So I don't know what your original problem was, but I'd be careful to
check and make sure that the
A request scope can be set anywere and is available anywhere during a
request. However its bad coding practice to use it in CFCs and what
not but as far as I can tell it can be done.
Adam
On Wed, 03 Nov 2004 13:25:35 -0500, Ben Doom [EMAIL PROTECTED] wrote:
Except that I do exactly what you
Oh it is passing the right info but maybe it's because I am doing this
on a 6.0 machine
Ian
On Wed, 03 Nov 2004 13:25:35 -0500, Ben Doom [EMAIL PROTECTED] wrote:
Except that I do exactly what you said didn't work all the time. I
routinely create request or variable scoped vars in one include
for that matter...
-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 03, 2004 1:26 PM
To: CF-Talk
Subject: Re: How to use Request scope?!
Except that I do exactly what you said didn't work all the time. I
routinely create request or variable scoped vars
It shouldn't matter what version. Request variables worked the way
documented in 5, I know from experience. They should work in 6.0 just fine.
But that raises the question of why you're running 6.0 instead of 6.1
with updaters. Is there are reason? If not, you should definately
update --
else. Were you getting test not defined in request scope errors?
Or any kind of error for that matter...
-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 03, 2004 1:26 PM
To: CF-Talk
Subject: Re: How to use Request scope?!
Except that I do
with the request scope anywhere else?
-Original Message-
From: Ian Sheridan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 03, 2004 2:19 PM
To: CF-Talk
Subject: Re: How to use Request scope?!
I was getting the actionpasser not defined in the Request scope.
This is basicly what I am doing
Have you checked that o.param contains a valid value?
On Wed, 3 Nov 2004 14:18:49 -0500, Ian Sheridan [EMAIL PROTECTED] wrote:
I was getting the actionpasser not defined in the Request scope.
This is basicly what I am doing:
!--- include1.cfm ---
cfset request.actionpasser = o.param
oh yeah it works I am getting the expected value in o.param.
On Wed, 3 Nov 2004 15:15:46 -0800, Sean Corfield [EMAIL PROTECTED] wrote:
Have you checked that o.param contains a valid value?
On Wed, 3 Nov 2004 14:18:49 -0500, Ian Sheridan [EMAIL PROTECTED] wrote:
I was getting the
On Wed, 3 Nov 2004 18:29:00 -0500, Ian Sheridan [EMAIL PROTECTED] wrote:
oh yeah it works I am getting the expected value in o.param.
Where is o.param set? You didn't show that in your cut-down code...
!--- include1.cfm ---
cfset request.actionpasser = o.param
!--- include2.cfm ---
Either way, it had to be set or the error he would get would be PARAM not
defined in O.
-Original Message-
From: Sean Corfield [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 03, 2004 8:02 PM
To: CF-Talk
Subject: Re: How to use Request scope?!
On Wed, 3 Nov 2004 18:29:00 -0500, Ian
o.param is a string that I get out of a CFPROCEDURE it's there and
avaiable. I have focused it down to the setting the request variable.
when I dump and abort the o.param it's there.
Ian
On Wed, 3 Nov 2004 17:02:11 -0800, Sean Corfield [EMAIL PROTECTED] wrote:
On Wed, 3 Nov 2004 18:29:00
17 matches
Mail list logo