Support Article

Modal Dialog action does not work correctly in Firefox

SA-12591

Summary



A button on click of which a modal dialog opens which in turn opens a repeat grid. On click of any row the below script runs. 

function submitModalDlg() { 
doModalAction(pega.u.d.submitModalDlgParam,event) 

function cancelModalDlg() { 
doClose(); 


The modal dialog by default has Submit and Cancel buttons. Instead of using the buttons, the above script was used to perform the action. This works fine in IE, Chrome and Safari browsers but not in Firefox browser.


Error Messages



Not Applicable

Steps to Reproduce



1. Create a button and on click on it add a action "local action" to open a modal dialog. 
2. This modal dialog opens a repeat grid. 
3. Configure an action " run a script" in the repeat grid. 
4. Run the flow or launch the portal in IE, Chrome and Firefox.


Root Cause



This is a browser implementation behavior - Chrome and IE have global event objects but Firefox does not. The same needs to be passed in from the call of the custom script. 

Resolution



Changing the code to below solves the issue. 

function submitModalDlg(e) { 
debugger; 
doModalAction(pega.u.d.submitModalDlgParam,e); 

function cancelModalDlg() { 
doClose(); 
}


Custom script accepts an event object as a parameter. Hence use the parameter, "javascript:event" notation in the run script configuration in the action tab.

Run script configuration passes on this event object using the "javascript:event" notation. 

Published July 31, 2015 - Updated October 8, 2020


100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.