Implement onBeforePresent and onAfterPresent action events