Title: RE: Last event
Thread: Last event
Forum: Enhancements
Conference: ColdBox
User: oscararevalo
I think this is something that should be solved using the existing features of
the framework rather than extending it. For example a quick solution that comes
to mind is to use the onRequestStart event handler to set two
session/cookie/client variables and use them to track the current and last
events executed. For example:
[code]
if(not
structKeyExists(cookie,"lastEvent")) cookie.lastEvent="";
if(not structKeyExists(cookie,"currentEvent"))
cookie.lastEvent="";
cookie.lastEvent = cookie.currentEvent;
cookie.currentEvent = getValue("Event","");
[/code]
Then
anytime you want the event from the previous request, just refer to
cookies.lastEvent