Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Submit modal quickly after Click events on grid fail validation

SA-55446

Summary



A modal dialog is launched that loads a grid. The rows of the grid have an Expand pane configured to load a nested inner grid. Users must "select" a row within the inner nested grid before submitting the modal dialog.

If a user does not select a row, then a validation is fired. However, if a user selects a row and quickly attempts to submit the modal dialog, the validation can still sporadically fail despite the fact that the user selected a row.

For example, Actions 1 and 2 (depicted in the image below) fired in quick succession can cause the configured validation to fail.


Error Messages



Not Applicable


Steps to Reproduce

  1. Design a modal dialog to load a grid that loads an inner nested grid for its Expand pane.
  2. Add Click actions on the inner grid to perform business logic and capture row click.
  3. Add validation to fire upon local flow action submission.
  4. Click the row and submit it in quick succession.


Root Cause



An application design issue
The Click event for the row click is specified to perform multiple actions to achieve various server-side business logic.
Example:



If a user does not allow for enough time for the business logic to fully process its actions, the act of quickly submitting the modal dialog can defeat the validation.

Resolution



If the application cannot be refactored to avoid this problematic design, the developer can consider using one or both of the following local changes.
  • Wrap the action set with Run Script calls. Then call custom functions to show and hide a busy indicator before and after the business processing. These custom functions can be defined in UserWorkForm.
Example:
 
function showBusyIndicator(){ 
if(pega.u.d.gBusyInd) { 
var origBusyIndInterval = pega.u.d.gBusyInd.busyIndInterval; 
pega.u.d.gBusyInd.busyIndInterval = 0; 
}else { 
var origBusyIndInterval = pega.u.d.busyIndInterval; 
pega.u.d.busyIndInterval = 0; 


pega.u.d.setBusyIndicator(document.body,true,true); 
pega.u.d.gBusyInd.busyIndInterval = origBusyIndInterval; 


function hideBusyIndicator(){ 
pega.u.d.gBusyInd && pega.u.d.gBusyInd.hide(); 
}
  • Wrap the action set with Run Script calls. Then call custom functions to disable/enable the submit button before and after the business processing. These custom functions can be defined in UserWorkForm.
Example:

function disableSubmit(){
var submitBtn = document.getElementById("ModalButtonSubmit");
submitBtn.disabled = true;
}

function enableSubmit(){
var submitBtn = document.getElementById("ModalButtonSubmit");
submitBtn.disabled = false;
}
  • Wrap the action set and use both local changes described above:

Published January 16, 2019 - Updated October 8, 2020

Was this useful?

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.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us