Additional parameters for Fusebox 5.5, event.xfa()

April 29, 2008

This is documented in the Fusebox 5.5 release notes, but if like me you've forgot it then to add additional parameters to an Xfa just do this:


<cfset event.xfa("next", "main.home", "message", "Thank you!") />

The clever thing is that it uses the Search Engine Safe URL parameters, which you can set up in the FUSEBOX_PARAMETERS section of your Application.cfc, to delimit the string correctly and also URL encodes the values. So the above method call will give you the following:

No SES


main.home&message=Thank%20you!

With SES


main.home/message/Thank%20you!

To add multiple parameters, just keep adding them as value pairs to your event.xfa method call


<cfset event.xfa("next", "main.home", "article", "201", "caller", "myotherpage", "message", "Thank you!") />

It is worth noting that you can't use the following syntax:


<cfset event.xfa( name="next", value="main.home", "article","201", "caller", "myotherpage", "message", "Thank you!") />

As you are mixing styles for passing arguments.


3 comments

  1. NICE! exactly what I was looking for... thanks for the final line of mixing the two ways of passing arguments.

    Comment by cfPB – July 29, 2008
  2. One thing to note, which isn't apparent anywhere, is that when you use event.xfa, you are only specifying one xfa. When I first read the docs, and found this example, I incorrectly read the following:

    <cfset event.xfa("next", "main.home", "article", "201", "caller", "myotherpage", "message", "Thank you!") />

    as the ability to specify multiple xfa's, when in fact you are specifying ONE xfa with whatever the arguments you want it to have passed along with.

    So, you would call event.xfa for each xfa you needed to set.

    Comment by Robert – December 03, 2008
  3. Hi Robert, that's correct. You can only set one xfa at a time.

    Comment by John Whish – December 04, 2008

Leave a comment

If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)

Please note: If you haven't commented before, then your comments will be moderated before they are displayed.