Question
Nordea
SE
Last activity: 8 Dec 2015 9:40 EST
Error on UI
Hi,
I am using pega 6.3 SP1 and getting below error while launching a modal window:--
Message: Invalid argument.
Line: 1
Char: 46758
Code: 0
On PDN I have seen several people facing the similar issue and I was advised to make changes in pega_ui_modaldialog js to resolve the issue (https://pdn.pega.com/forums/user-interface/java-script-error-modal-window-launch) however it didn't help me out. Could you please advice if I should be raising an SR on this?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
JPMC
IN
Hi Anand,
Looks its an existing bug in the system and we have a hotfix.
Try the following:
Do private edit of this rule and inside this setModalDialogHeight fucntion, replace the following
if(pega.u.d.modalDialog.cfg.getProperty("fixedcenter") === false){
var modalContainer = this.modalDialog ? this.modalDialog.element : null;
modalContainerTop = modalContainer ? modalContainer.offsetTop : 0;
}
with
if(pega.u.d.modalDialog.cfg.getProperty("fixedcenter") === false && !isPortal){
var modalContainer = this.modalDialog ? this.modalDialog.element : null;
modalContainerTop = modalContainer ? modalContainer.offsetTop : 0;
}
Then save and relaunch your portal by deleting browser cache and test the usecase.
JPMC
IN
Hi Anand,
What is the ruleset name and version of the file pega_ui_modaldialog at your end?
Also copy the code of the function called "setModalDialogHeight" in that file at your end, i would liek to review that.
Nordea
SE
Hi Ashish,
The JS file in Pega-UIEngine : 06-03-10. Please find below the code snippet of the function you asked for:--
pega.ui.Doc.prototype.setModalDialogHeight = function(modalDialogBody,actionIframeSec,dimensionObj){
if(!pega.u.d.useOldModalDialog)
return;
var modalDialogBodySH = modalDialogBodySHNonIe = 0;
if(pega.util.Event.isIE){
modalDialogBodySH = pega.u.d.getDivScrollHeight(modalDialogBody,false);
}else{
// BUG-75741: In firefox modaldialog is not resized properly when there is decrease in content height.
//modalDialogBodySH = pega.u.d.getDivScrollHeight(document.getElementById("modaldialog_bd"),false);
modalDialogBody.style.height = "auto";
modalDialogBodySH = modalDialogBodySHNonIe = pega.u.d.getDivScrollHeight(modalDialogBody,false);
}
if(pega.u.d.MODALDIALOG_MIN_HEIGHT < parseInt(modalDialogBodySH)) {
pega.u.d.MODALDIALOG_MIN_HEIGHT = parseInt(modalDialogBodySH);
}
var contentHieght = dimensionObj.height;
var wagIframeEle = null;
var isPortal = false;
var panelDiv = null;
var portalHarnessBody = null;
Hi Ashish,
The JS file in Pega-UIEngine : 06-03-10. Please find below the code snippet of the function you asked for:--
pega.ui.Doc.prototype.setModalDialogHeight = function(modalDialogBody,actionIframeSec,dimensionObj){
if(!pega.u.d.useOldModalDialog)
return;
var modalDialogBodySH = modalDialogBodySHNonIe = 0;
if(pega.util.Event.isIE){
modalDialogBodySH = pega.u.d.getDivScrollHeight(modalDialogBody,false);
}else{
// BUG-75741: In firefox modaldialog is not resized properly when there is decrease in content height.
//modalDialogBodySH = pega.u.d.getDivScrollHeight(document.getElementById("modaldialog_bd"),false);
modalDialogBody.style.height = "auto";
modalDialogBodySH = modalDialogBodySHNonIe = pega.u.d.getDivScrollHeight(modalDialogBody,false);
}
if(pega.u.d.MODALDIALOG_MIN_HEIGHT < parseInt(modalDialogBodySH)) {
pega.u.d.MODALDIALOG_MIN_HEIGHT = parseInt(modalDialogBodySH);
}
var contentHieght = dimensionObj.height;
var wagIframeEle = null;
var isPortal = false;
var panelDiv = null;
var portalHarnessBody = null;
var isActionIframe = (window.frames.name == "actionIFrame");
if(isActionIframe) {
wagIframeEle = window.parent.frameElement;
if(wagIframeEle != null && typeof(wagIframeEle.PegaWebGadget) != "undefined" && typeof(window.parent.parent.pega) != "undefined" && typeof(window.parent.parent.pega.u) != "undefined" && typeof(window.parent.parent.pega.u.d) != "undefined" && window.parent.parent.pega.u.d.isPortal()) {
isPortal = true;
panelDiv = parent.pega.u.d.getPanelDiv();
portalHarnessBody = parent.parent.document.body;
}
} else {
wagIframeEle = window.frameElement;
if(wagIframeEle != null && typeof(wagIframeEle.PegaWebGadget) != "undefined" && typeof(window.parent.pega) != "undefined" && typeof(window.parent.pega.u) != "undefined" && typeof(window.parent.pega.u.d) != "undefined" && window.parent.pega.u.d.isPortal()) {
isPortal = true;
panelDiv = pega.u.d.getPanelDiv();
}
}
if(isPortal) {
var offset = 0;
if(isActionIframe) {
offset = pega.u.d.getOffSet(window.frameElement,window.parent.frameElement.contentWindow.document.body) + pega.u.d.getOffSet(wagIframeEle,portalHarnessBody) - pega.u.d.getOffSet(panelDiv,portalHarnessBody);
} else {
offset = pega.u.d.getOffSet(window.frameElement,panelDiv.parentNode);
}
var panelParentNode = panelDiv.parentNode;
var panelScrollTop = panelParentNode.scrollTop;
var panelOffSetHt = panelParentNode.offsetHeight;
var docOffSetHt = document.body.offsetHeight;
if(panelParentNode.scrollTop - offset > 0) {
contentHieght = panelOffSetHt;
} else {
contentHieght = panelOffSetHt-(offset - panelScrollTop);
}
if((docOffSetHt-panelScrollTop-offset) < (panelOffSetHt-offset)) {
contentHieght = docOffSetHt-panelScrollTop-offset;
}
}
if(contentHieght > pega.u.d.MODALDIALOG_ADJUSTMENT ){
contentHieght = contentHieght - pega.u.d.MODALDIALOG_ADJUSTMENT;
}
var styleCssText = "", headerHeight = 0, footerHeight = 0;
if(pega.u.d.MODALDIALOG_BUTTONS_HEIGHT == 0) {
var sectionTable = pega.util.Dom.getElementsById("EXPAND-OUTERFRAME", document.getElementById("modaldialog_bd"), "TABLE");
if(sectionTable != null){
sectionTable = sectionTable[0];
var buttonsTable = sectionTable.nextSibling;
if(buttonsTable != null){
while(buttonsTable.nodeType !=1){
buttonsTable = buttonsTable.nextSibling;
if(buttonsTable == null) break;
}
if(buttonsTable != null) {
pega.u.d.MODALDIALOG_BUTTONS_HEIGHT = buttonsTable.offsetHeight;
}
}
}
}
// BUG-58465 1/4/2012 koduc if condition is commented because modaldialog_bd height must be set to auto in all browsers if not rezise icon will not be visible.
//if(pega.util.Event.isIE) {
document.getElementById("modaldialog_bd").style.height = "auto";
//}
//End of BUG-58465
if(document.getElementById("modaldialog_hd") != null ){
headerHeight = document.getElementById("modaldialog_hd").offsetHeight;
}
if(document.getElementById("modaldialog_ft") != null ){
footerHeight = document.getElementById("modaldialog_ft").offsetHeight;
}
// BUG-75718: In IAC when modaldialog is loaded at the bottom and dialog content height is increased scrollbars are not coming for dialog.
var modalContainerTop = 0;
if(pega.u.d.modalDialog.cfg.getProperty("fixedcenter") === false){
var modalContainer = this.modalDialog ? this.modalDialog.element : null;
modalContainerTop = modalContainer ? modalContainer.offsetTop : 0;
}
if( (modalDialogBodySH + headerHeight + pega.u.d.MODALDIALOG_BUTTONS_HEIGHT + footerHeight + modalContainerTop ) > contentHieght && !actionIframeSec){
modalDialogBody.style.height = contentHieght - headerHeight - pega.u.d.MODALDIALOG_BUTTONS_HEIGHT - modalContainerTop + 'px';
pega.u.d.MODALDIALOG_MIN_HEIGHT = contentHieght - headerHeight - pega.u.d.MODALDIALOG_BUTTONS_HEIGHT - modalContainerTop;
/* add scollbar adjustment to width. else we get an unnecessary horizontal scrollbar*/
if(modalDialogBody.style.overflow !="auto"){
var borderWidth = parseInt(window.getComputedStyle?(window.getComputedStyle(modalDialogBody, null)["borderLeftWidth"]||modalDialogBody.style.overflow): (modalDialogBody.currentStyle ? modalDialogBody.currentStyle["borderLeftWidth"]:modalDialogBody.style.borderLeftWidth||0)) + parseInt(window.getComputedStyle?(window.getComputedStyle(modalDialogBody, null)["borderRightWidth"]||modalDialogBody.style.overflow): (modalDialogBody.currentStyle ? modalDialogBody.currentStyle["borderRightWidth"]:modalDialogBody.style.borderRightWidth||0));
borderWidth = isNaN(borderWidth) ? 0 : borderWidth;
document.getElementById("modaldialog").style.width = parseInt(modalDialogBody.scrollWidth)+ pega.u.d.SCROLL_ADJUSTMENT+borderWidth + 'px';
}
styleCssText += "overflow: auto;";
}else {
var styleCssText = "";
if(parseInt(modalDialogBodySH) > pega.u.d.MODALDIALOG_MIN_HEIGHT && (pega.u.d.modalTabContentWidth != 0)){
var height = pega.u.d.MODALDIALOG_MIN_HEIGHT + pega.u.d.SCROLL_ADJUSTMENT;
styleCssText += "height: " + height +"px;";
}
else {
if(pega.util.Event.isIE) {
var height = modalDialogBodySH + pega.u.d.SCROLL_ADJUSTMENT;
}
else {
var height = modalDialogBodySHNonIe;
if(modalDialogBody.scrollWidth > modalDialogBody.offsetWidth) {
height = height+pega.u.d.SCROLL_ADJUSTMENT;
}
}
styleCssText += "height: " + height +"px;";
}
if(modalDialogBody.style.overflow !=""){
pega.u.d.modalDialog.cfg.setProperty("height","");
styleCssText += "overflow:auto;";
}
}
if(pega.util.Event.isIE) {
document.getElementById("modaldialog_bd").style.height = "auto";
}
modalDialogBody.style.cssText += ";" + styleCssText;
};
Accepted Solution
JPMC
IN
Hi Anand,
Looks its an existing bug in the system and we have a hotfix.
Try the following:
Do private edit of this rule and inside this setModalDialogHeight fucntion, replace the following
if(pega.u.d.modalDialog.cfg.getProperty("fixedcenter") === false){
var modalContainer = this.modalDialog ? this.modalDialog.element : null;
modalContainerTop = modalContainer ? modalContainer.offsetTop : 0;
}
with
if(pega.u.d.modalDialog.cfg.getProperty("fixedcenter") === false && !isPortal){
var modalContainer = this.modalDialog ? this.modalDialog.element : null;
modalContainerTop = modalContainer ? modalContainer.offsetTop : 0;
}
Then save and relaunch your portal by deleting browser cache and test the usecase.
Nordea
SE
Hi Ashish,
This worked!! Thank you so much for providing the solution. Could you please let me know the HFIX details as the rule is final and to make changes in that rule I need to raise an SR to get that HFIX.
Pegasystems Inc.
US
Hi Anand Pandey
Were you able to open an SR? If so, please reply with the SR so that we may track it.
Thanks in advance!
Nordea
SE
Hi,
I can raise an SR but could you please confirm if there is any HFIX exists to resolve this issue? If yes, i'll mention the HFIX detail in my SR.
JPMC
IN
Hi Anand,
There was a hotfix for this, but after that also many changes have been added to the system so we will provide you the latest hotfix for that file Please raise Sr and in that mention this thread link
Also share the SR numnber in this post
Regards
Ashish
Pegasystems Inc.
IN
Hi Anand,
Thank you for sharing the SR number. We will track it for you here.
Thanks!
Pegasystems Inc.
IN
Hi,
Couple of more questions which might give us a better understanding of the issue.
1. What is the use case , how and when you are trying to launch the modal ? The screenshot shows that there is a list or grid kind of stuff behind ? So is it something like you wan to edit or update your grid entry ?
2. Or is it a listview having smart info in place ?
3. What is the browser ?
Nordea
SE
Hi Santanu,
I am launching the modal window from a button which is embedded in the repeating grid as shown in the screenshot. After entering the value in modal window, it is making some minor changes in repeating grid.
I am using IE 8 browser.
Pegasystems Inc.
IN
Hi
Thanks for the input. Can you check the behavior once by changing the edit setting of the grid to Modal Dialog ? It is showing the same behavior ?
Nordea
SE
Yes, I was getting the same error. Having said that, the behavior of this error is quite intermittent.