Question
Capgemini
CA
Last activity: 25 Oct 2019 12:22 EDT
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***