See whether a mapping exists?

11 views
Skip to first unread message

Joe Bodell

unread,
Jan 12, 2012, 11:23:11 AM1/12/12
to mach-ii-for...@googlegroups.com
All,

I'm trying to reuse some listener code, but one event requires a check to see if a particular event-mapping exists. I don't see anything like a isMappingDefined() method on the event or eventContext objects....am I missing anything?

Worse comes to worse, I can just separate the logic into two separate listener methods, but I thought it made for an interesting question.

Thanks,

Joe

Kurt Wiersma

unread,
Jan 18, 2012, 7:45:01 PM1/18/12
to mach-ii-for...@googlegroups.com
It seems like you really should use a new listener method or define
the mapping in both event handlers.

--Kurt

> --
> To post to this group, send email to mach-ii-for...@googlegroups.com
> For more options and to unsubscribe, visit this group at
> http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
>
> SVN: http://svn.mach-ii.com/machii/
> Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/

Peter J. Farrell

unread,
Jan 19, 2012, 1:21:02 PM1/19/12
to mach-ii-for...@googlegroups.com
Kurt Wiersma said the following on 01/18/2012 06:45 PM:

> It seems like you really should use a new listener method or define
> the mapping in both event handlers.
I agree with Kurt on this.

However, there is an isEventMappingDefined() method in the EventContext
however by design - you cannot access the EventContext from a Listener.

.pjf

--
Peter J. Farrell
pe...@mach-ii.com
p...@maestropublishing.com
http://blog.maestropublishing.com
Identi.ca / Twitter: @maestrofjp

Reply all
Reply to author
Forward
0 new messages