Support Article
OnChange and Run activity ActionSet in grid function incorrectly
Summary
Use has a repeating grid layout in which a textbox is configured onChange of which, an activity must run and Refresh Other section must occur.
On entering a value in the first row of the textbox, the activity executes correctly. The Step page for the activity is PageName.PxResults(1).
However, on entering the value in row two of the textbox, the Activity executes, but the Step page is still PageName.PxResults(1). That is, the changes made to the second row do not display. This works correctly the third time and is intermittent.
Error Messages
Not Applicable
Steps to Reproduce
- Create a repeating grid such that users can enter values.
- Create another repeating grid layout and source it with the PageName.PxResults (result of the first grid).
- Create a textbox in the first grid.
- Set an onChange event and add multiple Action sets, such as Run activity, Refresh other Section section, Refresh current row, Run script invoking the makeUIBusy function, Post value and so on.
- Invoke both the sections in a single section.
Root Cause
Limitation of Pega 7 Platform. The Platform does not support multiple actions.
When consecutive actions are present on the onChange event, the following action cancels if the previous action is in progress (hence, subsequent onChange event is discarded).
With Pega 8 Platform, this use case works by default.
Resolution
Perform the following local-change:
Add the below script in the UserWorkForm to remove the focus from the next textbox:
<script>
var makeUIBusy = function (evt) {
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, false, true);
window.setTimeout(function () {
document.querySelector("#pega_ui_mask img").tabIndex = 0;
document.querySelector("#pega_ui_mask img").focus()
}, 0);
pega.u.d.gBusyInd.busyIndInterval = origBusyIndInterval;
}
var hideBusyIndicator = function () {
pega.u.d.gBusyInd.hide();
}
</script>
Published October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.