I’m having trouble triggering an Incisor app event with more than one argument.
The console output:
spinResult Defined
spinResult Callback Added
5
undefined (I expect this to read “7777”)
TestAppEvent: CODE VALIDATION FAILED: ‘string=’ expects the parameter ‘string’ to be type ‘string’, but type ‘undefined’ was provided.
How do I get multiple arguments to be available in my callback function?
class ProjectMain
{
init()
{
this.text = new TextAssembly();
this.text.string = "Build It Once.";
// Define the event here
nc.defineAppEvent("spinResult");
console.log("spinResult Defined");
// Add the callback for the "spinResult" event
nc.appEvents.spinResult.addCallback(this, "spinResultCallback");
console.log("spinResult Callback Added");
// Trigger the event with multiple arguments
nc.appEvents.spinResult.trigger(5, "7777");
}
/**
* spinResultCallback
*/
spinResultCallback(resultData, message)
{
console.log(resultData);
console.log(message);// this should read "7777"
this.text.string = message;
}
}