The additional request is a drag to be sure, but if you need to retain any
attribute settings, pass them through in the url_ redirector. The url_ file
is still the best way to preserve your "root" circuit so that you can easily
move from circuit to circuit.
Besides...in a stateless environment can you really "lose" state? (that's a
joke)
-----Original Message-----
From: Patrick McElhaney [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 12:03 PM
To: Fusebox
Subject: Taking the fuses out of the fusebox.
Has anyone ever tried taking the cfswitch
statement and putting it in a seperate file,
so that we can change the fuseaction without
using <cflocation>? (The point is that by
redirecting we lose state, and waste time
with an additional request.)
INDEX.CFM
---------
..... standard fusebox stuff ...
<cftry>
<!---
If something goes wrong in a fuse,
attributes.fuseaction will be changed
and an exception will be thrown.
--->
<cfinclude template="fuseactions.cfm">
<cfcatch type="any">
<cfinclude template="fuseactions.cfm">
</cfcatch>
</cftry>
FUSEACTIONS.CFM
---------------
<cfswitch expression="#attributes.fuseaction#">
<cfcase value="addform">
<cfinclude template="dsp_form.cfm">
</cfcase>
<cfcase value="editform">
<cfinclude template="qry_data.cfm">
<cfinclude template="dsp_form.cfm">
</cfcase>
<cfcase value="insert">
<cfinclude template="act_insert.cfm">
<cfinclude template="dsp_view.cfm">
</cfcase>
<cfcase value="update">
<cfinclude template="act_update.cfm">
<cfinclude template="dsp_view.cfm">
</cfcase>
<cfdefaultcase>
<cfset attributes.fuseaction="addform">
</cfdefaultcase>
</cfswitch>
Patrick
----------------------------------
Patrick McElhaney
Application Developer
American City Business Journals
704-973-1019 704-236-8351 (cell)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists