> Is there a trick...to getting "Request" variables to work
> with pages that have frames?
> Something like this works in pages without frames. What
> gives?
> <cflock SCOPE="Application" THROWONTIMEOUT="NO"
> TIMEOUT="10"
> TYPE="Exclusive">
> <cfscript>
> Application.BGColor="FFFFFF"; // White
> Application.FlagColor="FF0000"; // Dark Red
> //
> Request.AdminVars = Duplicate(Application);
> </cfscript>
> </cflock>
> Am I missing something???
> Ch� Vilnonis
> Application Developer
> Advertising Systems Incorporated
> 8470C Remington Avenue
> Pennsauken, NJ 08110
> p: 856.488.2211
> f: 856.488.1990
> www.asitv.com
Request variables only exist within the current request which includes the
Application.cfm (if any), OnRequestEnd.cfm (if any), the base template
(index.cfm for instance) and any templates included in the base template
either with <cfinclude> or <cfmodule> (or the alternate <cf_tag> syntax for
calling custom tags).
While a CF Template can generate and output an html document which contains
html elements with SRC attributes (frames,iframes,images,script libraries
and style sheets, any of which may be a coldfusion template), the html
elements which include these extra files require an additional http request
from the browser and are not actually a part of the parent template request
(the cf template containing the frameset for instance). That being said,
your frames page looks like this:
FRAMESET.CFM
<cf_stuff>
<frameset ...>
<frame name="blah" src="blah.cfm">
<frame name="blah2" src="blah2.cfm">
</frameset>
So if you call http://www.mydomain.com/frameset.cfm frameset.cfm is a
request that includes Application.cfm and OnRequestEnd.cfm (if available)
and then the same is also true of blah.cfm and blah2.cfm which are each
their own requests. So if you need to copy data down from the application
scope into the request scope so that it's available in blah.cfm and
blah2.cfm you have to do that within each of those requests. If you use an
Application.cfm for this purpose, then you can allow the one reference to
handle all requests for you without having to copy and paste or include the
code on every page.
On a related note, if you use this code on every page:
> <cfscript>
> Application.BGColor="FFFFFF"; // White
> Application.FlagColor="FF0000"; // Dark Red
> //
> Request.AdminVars = Duplicate(Application);
> </cfscript>
You'll be needlessly accessing the application scope anyway. The application
scope should really only be used for data which might change periodically
based on time of day, administrative interraction (i.e. "this feature is
currently unavailable due to maintenance"), or to refresh a cacheing
routine, etc. Data which is set, static and required on every page should be
set solely in the request scope, unless you're running CFMX and planning to
access it directly from the application scope -- which I prefer not to do
because imho there's no real benefit over using the request scope while
there are definite advantages to using the request scope if you end up
needing backward compatibility for CF 5.
hth
s. isaac dealey 954-776-0046
new epoch http://www.turnkey.to
lead architect, tapestry cms http://products.turnkey.to
tapestry api is opensource http://www.turnkey.to/tapi
certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4