Fusebox 101: What's XFA all about?
I've just been chatting with someone about the XFA in verb for fusebox and I thought I would post my thoughts.
XFA stands for eXit FuseAction - this is where you store variables to be used in your web pages. The question here is, why use it?
Well imagine this, you have a login form that is used on your website. When a user goes to certain areas, you check to see if the user is logged in. If they are, then they will continue as normal, on the other hand they will need to login.
Being a great coder you don't want to have lots of forms all over the place, so you include one login form. This form then performs different actions depending on the what you need it to do.
Instead of having cfif's at the top of the form tell the form where it should go, you simple use the XFA verb that fusebox provides to store you variables. For example:
<xfa name="login" value="user.actLogin" />
< include template="frmLogin" contentvariable="layout.bodyContent" />
</fuseaction>
<fuseaction name="adminLogin">
<xfa name="login" value="admin.actLogin" />
< include template="frmLogin" contentvariable="layout.bodyContent" />
</fuseaction>
Both these fuseactions called (userLogin, adminLogin) include the same form page but have different XFAs. Your login form could look like:
<input id="userName" ... />
<input id="password" ... />
<input id="submit" ... />
</form>
Using XFAs allows code/pages to be reused in lots of places like: forms, links, relocations etc.
If you are using fusebox 3 you would set your XFA in the FBX_Switch.cfm page like
For XFAs in fusebox 3, Hal has a great post here
PS: this is my 250th blog post - w00t!





The logic of this post isn't really about how to handle your logins but how to use XFAs. I'm also not suggesting where one checks to see if a user is logged in.
You are right in the fact that every time you call in the login page you will need to set the XFA, but this is small cost for a reusable page.
http://livedocs.adobe.com/wtg/public/machiidevguid...
And from there I took it into Model-Glue as well in early 2005:
http://corfield.org/entry/ModelGlue_Sample_Applica...
It really is a powerful abstraction!