Luis Majano Forums Notification: Post to Last event

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

http://www.luismajano.com/forums/index.cfm?event=ehMessages.dspMessages&threadid=0561A0E5-123F-6116-42AAF560F3DC61DD