English English Spanish EspañolKorea한국어
Straker»Company»Blog»2007» Forcing NOF Events To Fire

Forcing NOF Events To Fire

Whilst testing we came up against the problem that testing certain NOF events is difficult due to the fact that the criteria for the events to fire are often difficult to reproduce.

To get around this we found out how to manually force he events to fire. 

The code we used is as follows:

<cfscript>
arguments.catch = "Any";
arguments.class = "[NOF class]";
arguments.event = "[NOF Event]";
arguments.audit = FALSE;
structAppend(arguments,application.shado.eventService.doEvent(argumentCollection=arguments));
<cfscript>

This will allow you to manually fire any event in any NOF class, for example to fire the "onError" event in the "Pages" Nof Object you would use the following code:

<cfscript>
arguments.catch = "Any";
arguments.class = "pages";
arguments.event = "onerror";
arguments.audit = FALSE;
structAppend(arguments,application.shado.eventService.doEvent(argumentCollection=arguments));
<cfscript>


Comments

There are no comments for this page as yet.

Add a comment