CLICK!!! The light just went on... I think...
When you were talking about validating a person, it made me think of a login
sequence, where person validation is common. In a login, I will usually send
the request to a login fuseaction, then redirect the user depending on whether
they passed a valid login or not. With a RunAction call, I could do something
much simpler, and never have to send a redirect header to the browser, ading
to overhead and server processing:
<cfcase value="checkLogin">
<cfset RunAction(person.validate)>
<cfif isValid>
<cfset RunAction(open.sesame)>
<cfelse>
<cfset RunAction(person.login)>
</cfif>
</cfcase>
Am I on the right track?
David Huyck
[EMAIL PROTECTED]
----- Original Message -----
From: "Lee Borkman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 20, 2002 4:37 AM
Subject: Re: Like FuseQ, but with immediate execution - alpha testers please?
MessageHi Kay,
Well, the example I gave is a decent but simplified real world example (apart
from the yeehaa bit). Say a user has entered data for a new "person" in a
form, and submitted the form. You need to validate the data before you enter
it into your database. You have a substantial validation routine coded as a
fuseaction "person.validate".
In the example given, you RunAction("person.validate") to check that the data
is valid and return a flag (isValid). Then you use the value of the isValid
flag to decide if you will insert the data into the database, using tha
act_insertperson fuse.
A more complete example might be:
<cfcase value="handlenewpersondata">
<cfset RunAction("person.validate")>
<cfif isValid>
<cfinclude template="act_insertperson">
<cflocation URL="index.cfm?fuseaction=thankyou">
<cfelse>
<cflocation URL="index.cfm?fuseaction=baddata">
</cfif>
</cfcase>
That's all. It's exactly the same thing, no more and no less, that you could
do using a <cfmodule> call to run the person.validate fuseaction, except you
then have to pass the data around explicitly, you incur significant
performance overhead, and you have to do some work to ensure that you don't
get multiple layouts, etc.
Anyway, it's inspired by JohnQ and Patrick's seperate work, with some Baltic
help in figuring out the solution. I thank them all.
Bye now,
LeeBB
----- Original Message -----
From: Kay Smoljak
Hi guys,
I like all this talk of executing fuseactions, removing the need for
cfmodule etc... but could someone please give me a *real world* example of
where I would use this?
Kay.
Your "Stupid-Question-Asking" Steering Committee Member
-----Original Message-----
From: BORKMAN Lee [mailto:[EMAIL PROTECTED]]
Now John's FuseQ is great, but wouldn't it be nice if you could just
execute other fuseactions IMMEDIATELY, without the CFMODULE overhead, and
without creating an entirely seperate variable space?
It turns out that we can finally do this.
The call looks something like this:
<cfcase value="main">
<cfset RunAction("person.validate")>
<cfif isValid>
<cfinclude template="act_insertperson">
</cfif>
<cfset RunAction("stupid.yeehaa")>
</cfcase>
I believe that this will provide the same efficiency and power that FuseQ
promises, while being a rather more intuitive to use.
I have my alpha prototype working now. I am sure I can clean it up some
more. If anybody is interested in alpha-testing this with me, I'd love to
hear from you.
==^================================================================
This email was sent to: [email protected]
EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9
Or send an email to: [EMAIL PROTECTED]
T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================