Question

6
Replies
939
Views
X
Murthy.1303 Member since 2015 12 posts
Capgemini
Posted: 1 year ago
Last activity: 8 months 2 weeks ago

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 Interface SR Exists
Share this page LinkedIn