Support Article
Auto complete pop over issue
SA-37812
Summary
User complains that the Auto Complete control is not showing up in the same window in which the auto complete is present.
Error Messages
Not Applicable
Steps to Reproduce
1: Click on Actions tab of Report rule form and then click on Run option.
2: Click on the filter for modifying, it will display a pop-up window to modify the filters. Pop-up window will displayed with the filters, click down arrow on Auto Complete fields, instead of displaying options on the field in the same window its displaying the options in backend window.
Root Cause
A defect in Pegasystems’ code or rules.
When a pop-up window is opened, pega.ui.AutoComplete.prototype._getDivWindow is wrongly returning the parent window.
This has been caused by the fix of BUG-268946 where window.parent is replaced by pega.desktop.support.getDesktopWindow call.
Even when the child window is a pop-up, this returns the parent window.
Resolution
Add the below JS snippet in UserWorkForm/JS file included in harness:
<script>
pega.u.d.attachOnload(function() {
if(pega.ui.AutoComplete) {
pega.ui.AutoComplete.prototype._getDivWindow = function () {
var oInfoWindow = window;
if (this._skipParent != null && this._skipParent == "-1")
return oInfoWindow;
if (!opener && pega.desktop.support.getDesktopWindow() != window) {
pega.ui.AutoCompleteUtils.log("inside window parent if");
var parentWindow = pega.desktop.support.getDesktopWindow();
}
if (parentWindow == null) {
return oInfoWindow;
}
if ((typeof (parentWindow.openAssignment) != "function") || (typeof (parentWindow.openRule) != "function")) {
return oInfoWindow;
}
try {
// if no exception raised on next line, then within domain and parentWindow exists
parentWindow.test = "yes";
pega.ui.AutoCompleteUtils.log("inside try");
// if parent is not a frameset
if (parentWindow.document.getElementsByTagName("FRAMESET").length == 0) {
pega.ui.AutoCompleteUtils.log("inside window parent frameset if");
// set the global variable of the document
oInfoWindow = parentWindow;
}
} // try
catch (exception) {
pega.ui.AutoCompleteUtils.log("inside getdivdoc catch");
}// catch
return oInfoWindow;
}
}
}, true);
</script>
Published June 1, 2017 - 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.