ColdFusion, WordPress, Flash & other web things


relocator Mach-II filter

File name:
relocator.cfc
Version:
1
Last updated:
14 April 2005
Requirements:
Mach-II 1.0.10, CFMX 6.1

Place relocator.cfc in the MachII filters folder. Place this in the Mach-II configuration file:

<event-filter name="relocator" type="MachII.filters.relocator" />

When you want to relocate to a Mach-II event place this in your event-handler:

<filter name="relocator">
<parameter name="event" value="event_to_relocate_to" />
<parameter name="conditionalEventArg" value="name_of_event_arg_to_check" />
<parameter name="eventArgsToPass" value="list_of_event_args_to_pass_as_query_string" />
</filter>

This will cflocate to event_to_relocate_to with the event arguments specified in list_of_event_args appended to the URL if name_of_event_arg evaluates to true.

This filter is very useful if you need to announce an event after a form submission but do not want the user to be able to reload the page and post the form again.

Download relocator.cfc

3 comments

  1. #1: Christopher Town Says:

    Great idea! Elegant way to solve the refresh problem.

  2. #2: Dave Says:

    Thanks! One note: Using IE 6.0 on Win2K, I can’t select any of the text in the boxes…

  3. #3: Martin Says:

    Dave: I know about this issue. Apparently, this IE 6 “bug” happens when you use absolute or relative positioning for the container. I have looked into this issue and will probably fix it in the next batch of changes to this site.