Question

6
Replies
1625
Views
Close popover
Satyanarayana Murthy P (Murthy.1303)
Capgemini

Capgemini
CA
Murthy.1303 Member since 2015 12 posts
Capgemini
Posted: June 21, 2019
Last activity: October 25, 2019
Closed

Fire click event on button via Java script function

We are trying fire click event of a button from java script using PEGA api, but it is not firing defined click event.
Below is how we are trying to fire the event.
pega.util.Event.fireEvent(document.querySelector('button[data-test-id="<button-data-test-id>"]'),'click');

Steps:
1) Drag a Pega button, define click event.
2) Define a javascript function to call below line
pega.util.Event.fireEvent(document.querySelector('button[data-test-id="Pass the data test ID of the button"]'),'click');
3) Call javascript function

We do not see the event getting fired.

I even tried below method:
document.querySelector('button[data-test-id="Pass the data test ID of the button"]').click();
document.querySelector(".saverw").click();

***Edited by Moderator Marissa to update SR Details***

Pega Platform Data Integration Java and Activities User Experience Support Case Exists
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.