Just use redirectEvent() in your listener -- all commands and API
methods look for event-mappings first. The event name could even be an
event-mapping:
<event-handler event="something">
<event-mapping event="pass" mapping="somethingGood" />
<event-mapping event="fail" mapping="somethingBad" />
<notify listener="widget" method="makeDecision" />
</event-handler>
In makeDecision():
<cffunction name="makeDecision">
<cfargument name="event" />
... stuff ...
<cfif result>
<cfset redirectEvent("pass") />
<cfelse
<cfset redirectEvent("fail") />
</cfif>
</cffunction>
I added a new section to this wiki entry:
http://trac.mach-ii.com/machii/wiki/EventMappings#CommonQuestions
Scott said the following on 03/06/10 15:36:
It seems that after reading http://trac.mach-ii.com/machii/wiki/EventMappings,
that sometimes it would be nice for a listener to announce an event
that then looked at the event mappings and either did a regular
announce or redirect event. Is this possible using the same type
methodology as is discussed at the above link?
I realize that you could create another event that then triggered the
redirect xml tag. However http://trac.mach-ii.com/machii/wiki/MachII1.8Redirect
talks about using redirectEvent() to simplify the xml in the same way.
scott
--
You received this message because you are subscribed to Mach-II for CFML list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
***New URLs as of April 29th, 2010***
SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/