Support Article
Screen Shrinking while throwing validation message
SA-19293
Summary
In the screen, on click of Save button, an activity is called which throws a validation message on screen, due to which screen shrinks. First time Screen looks good as expected, but if that screen shows any validation message, it starts shrinking.
Error Messages
Not Applicable.
Steps to Reproduce
1. Create a flow with tabbed navigation and configure section(or harness) with more than one tab.
2. Each tab contain some controls like Autocomplete and drop down and so on along with some validation.
3. On click of Save button run activity which triggers the edit validate rule.
4. If user clicks Save without filling mandatory fields, error marker displays beside each field but at same time screen shrinks.
Root Cause
A software use or operation error.
User has configured a tabbed navigation flow within which they have configured N number of tabs to be shown at a time in one stage. In one of the tab, user has server side field validation configured.
On click of Save button validation is triggered, but once error messages appear screen shrinks.
Resolution
Perform the following local-change:
Add below script in userworkform:
<script>
pega.ui.Doc.prototype.displayFormErrors = function (errorText) {
// Check for empty error messages
if (errorText != null && errorText != "" && pega.u.d.removeEmptyLines(errorText) != "") {
if(pega.u.d.bIsFlowInModal == true && pega.u.d.bModalDialogOpen == true){
pega.u.d.displayErrorsOnModal(errorText);
}else if (pega.u.d.formErrorType == "FLOAT" && document.getElementById("FormErrorMarker_Div") != null) {
pega.u.d.FloatDivInit(errorText);
} else {
pega.u.d.defaultErrorDivInit(errorText);
}
}
// Check for error table
else if (document.getElementById("ERRORTABLE") != null) {
// Hide the ERRORTABLE when no error messages
document.getElementById("ERRORTABLE").style.display = "none";
}
/*HFix-21574: Updated last condition to check for 'display' property.*/
if(document.getElementById("HARNESS_CONTENT")&& document.getElementById("HARNESS_BUTTONS") && document.getElementById("PEGA_HARNESS") && (document.getElementById("ERRORTABLE") && document.getElementById("ERRORTABLE").style.display != "none")) {
if(pega.u.d.isInitialHarnessContentHeight) {
pega.u.d.initialHarnessContentHeight = parseInt(document.getElementById("HARNESS_CONTENT").offsetHeight,10);
pega.u.d.isInitialHarnessContentHeight = false;
}
/*HFix-21574: Suffixed 'px' while setting the height.*/
/*if(pega.util.Event.isIE && pega.util.Event.isIE != 11){ /// added check for IE11
document.getElementById("HARNESS_CONTENT").style.height=pega.u.d.initialHarnessContentHeight-(document.getElementById("PEGA_HARNESS").offsetHeight-document.getElementById("HARNESS_CONTENT").offsetHeight) + "px";
}*/
}
}
Published February 9, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.