ColdBox Forums Notification: Post to dynamically calling eventname

Title: RE: dynamically calling eventname
Thread: dynamically calling eventname
Forum: Need Help?
Conference: ColdBox
User: tonyg

Hi Luis,
I did notice the getEventName(). This returns just the string "event"
(or whatever the EventName is set at). I liked how the
viewState.getValue('myself') in Model-Glue gave you the whole "index.cfm?event="
string so you can just append your event to the value.
So I created a
decorator! Within I put this function:

[code]
<cffunction name="getSelf"
access="public" output="false" returntype="string">
  <cfset var eventName =
getRequestContext().getEventName() />
  <cfset var self = "/index.cfm?" &
eventName & "=" />
  <cfreturn self>
</cffunction>
[/code]

So now I can
emulate Model-Glue's viewState.getValue('myself') functionality with
event.getSelf()
Very cool!

thanks Luis.

-Tony

http://www.luismajano.com/forums/index.cfm?event=ehMessages.dspMessages&threadid=ED2D8303-FF65-CEF6-65BE18695C3BF0DC