Title: Message
Hi 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 -----

 
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
==^================================================================

Reply via email to