You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to pass parameters to a custom event through js file?

edited May 3, 2019 3:46PM in Visual Builder 3 comments

Summary

How to pass parameters to a custom event through js file?

Content

Hi, 

I created a custom event and an action chain with it that has a CallModuleFunction Action in it which calls a Module function that takes an input argument.

I am using EventHelper to call the Custom Event from the js file. Below is my code:-

  this.eventHelper = context.getEventHelper();
  this.eventHelper.fireCustomEvent("setCookieOnClickEvent", "en-US");  //Passing en-US to set as function param val called in action chain

I want to trigger the "setCookieOnClickEvent" event & pass the 2nd parameter to the input argument of the method selected in CallModuleFunction action.. but this doesn't work..the argument comes as undefined.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!