Actually... Now that I think of it, since the OnRequest() method
includes the content template... The entire page request should use the
"VARIABLES" scope that is private to the Application.cfc... So yeah,
that should work fine (although maybe its not exactly the proper
VARIABLES scope). 

The better test might be:

<cffunction name="OnRequest">
        <cfinclude template="#ARGUMENTS[ 1 ]#" />
</cffunction> 


.... Then in the included template, do this:

<cfset foo = "bar" />

<cfdump var="#VARIABLES#" />

See if "foo" shows up in that one.


......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Peter Boughton [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 12, 2007 11:09 AM
To: CF-Talk
Subject: Re: variables scope & app.cfc methods

Variables (of some form) does exist and is usable:
<cfcomponent>

        <cffunction name="OnRequestStart">
                <cfset Apple = "Apple"/>
                <cfset Request.Ball = "Ball"/>
                <cfset Variables.Camel = "Camel"/>
        </cffunction>

        <cffunction name="OnRequest">
                <cfdump var="#Apple#"/>
                <cfdump var="#Request#"/>
                <cfdump var="#Variables#"/>
        </cffunction>

</cfcomponent>

This all worked.
The Variables in the third dump contained both Apple and Camel.

>I am not sure if the "public" VARIABLES scope exists in the
>OnRequestStart() event method. It might not exist until OnREquest(). If

>it does, you are probably gonna get all kinds of conflicting issues 
>since VARIABLES is ALSO a scope within the Application.cfc component.
>
>Try this... Don't scope the variable at all. Just set variable names.
>ColdFusion by default puts these into the VARIABLES scope of the page.
>However, since you are in a component, this might not work (they might 
>go into THIS scope).
>
>Try the non-scoping method and see if that works. 
>
>
>.....................
>Ben Nadel
>Certified Advanced ColdFusion MX7 Developer www.bennadel.com
> 
>Need ColdFusion Help?
>www.bennadel.com/ask-ben/
>
>-----Original Message-----
>From: Leitch, Oblio [mailto:[EMAIL PROTECTED]
>Sent: Monday, March 12, 2007 10:48 AM
>To: CF-Talk
>Subject: RE: variables scope & app.cfc methods
>
>Thank you for the work around.  However, I was asking about the 
>variables scope, not the request scope.  If it can't be done, I'd 
>rather know that.
>
>Oblio
>
>-----Original Message-----
>From: Peter Boughton [mailto:[EMAIL PROTECTED]
>Sent: Monday, March 12, 2007 10:01 AM
>To: CF-Talk
>Subject: Re: variables scope & app.cfc methods
>
>Um, put it in the Request scope?
>
>> Does anyone know how to write a variables.var in the onRequestStart()

>> and be able to read it onRequest()?  The usual suspects don't seem to

>> work.
>
>This email message may contain privileged and/or confidential 
>information. If you are not the intended recipient(s), you are hereby 
>notified that any dissemination, distribution, or copying of this email

>message is strictly prohibited. If you have received this message in 
>error, please immediately notify the sender and delete this email 
>message from your computer.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & 
Flex 2. 
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272369
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to