Question
Morgan Stanley
IN
Last activity: 9 Sep 2016 2:12 EDT
Getting "com.pega.pegarules.pub.PRRuntimeError" while navigating from the screen after a Javascript act
The error below is thrown and can be seen in the logs after doing a javascript Operation.
com.pega.pegarules.pub.PRRuntimeError: PRRuntimeError
There is a custom HTML control which is a hyperlink and calls 2 javascript functions one after the other. The first JS function opens a window in the background by calling an activity and doing a Show-HTML of the window. The 2nd JS function calls another function (which is written in the html file of the opened window) by taking its handle and opens up another window as a pop up. This functionality works fine. The background window as well as the pop up window opens up showing the contents.
Now after clicking on the hyperlink and getting the popup window, when i close it (popup but not the background window) and do some refresh action on my harness, i get blank white screen with message "No Stream to Display". In the logs PRRuntime error is shown.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
Hello Ankita,
We would like get more into the details of the bahviour. Could you please share the following things to get better understand of the issue.
1) Please share complete stack trace of the exception.
2) Please share the configuration/code of the custom control.
3) Please share code of two javascript methods your are calling on the control.
Thank you,
Morgan Stanley
IN
Hi cherb,
Please find the code for both of the windows below:
Background popup window code: kmLauncher (html rule)
<title>KM Launcher</title>
<script type="text/javascript"></script>
<script language="JavaScript">
/* document.domain = document.domain.substring(document.domain.indexOf('.') + 1); */
var kmWindowCounter = 0;
var kmName = "kmLauncher";
var kmServiceLineDT = "serviceLineDT";
var serviceLineDT = false;
var newWindowsArray = new Array();
var tceWindow = null;
var compareClaimsWindow = null;
var procRevCodeDetailWindow = null;
var accumWindow = null;
var pharWebWindow = null;
var drugPricingToolWindow=null;
var pharmacyGoogleMapsWindow=null;
var formularyToolWindow=null;
var checkImageWindow = null;
var claimImageWindow = null;
var memberEobImageWindow = null;
var providerEobImageWindow = null;
var googleMapsWindow=null;
var dashboardWindow = null;
setInterval ( "checkOpener()", 2000 );
function onLoadPage() {
setCookie(kmName, "true", "","/");
}
function unloadPage() {
deleteCookie(kmName);
closeAllWindows();
}
Hi cherb,
Please find the code for both of the windows below:
Background popup window code: kmLauncher (html rule)
<title>KM Launcher</title>
<script type="text/javascript"></script>
<script language="JavaScript">
/* document.domain = document.domain.substring(document.domain.indexOf('.') + 1); */
var kmWindowCounter = 0;
var kmName = "kmLauncher";
var kmServiceLineDT = "serviceLineDT";
var serviceLineDT = false;
var newWindowsArray = new Array();
var tceWindow = null;
var compareClaimsWindow = null;
var procRevCodeDetailWindow = null;
var accumWindow = null;
var pharWebWindow = null;
var drugPricingToolWindow=null;
var pharmacyGoogleMapsWindow=null;
var formularyToolWindow=null;
var checkImageWindow = null;
var claimImageWindow = null;
var memberEobImageWindow = null;
var providerEobImageWindow = null;
var googleMapsWindow=null;
var dashboardWindow = null;
setInterval ( "checkOpener()", 2000 );
function onLoadPage() {
setCookie(kmName, "true", "","/");
}
function unloadPage() {
deleteCookie(kmName);
closeAllWindows();
}
function checkOpener() {
if (opener && !opener.closed) {
//alert("Opener same");
} else {
self.close();
}
serviceLineDT = checkServiceLineDT();
}
// Remove close all popups if serviceLineDT popup was closed
function checkServiceLineDT() {
if (serviceLineDT) {
for (i=0;i<newWindowsArray.length;i++)
{
if (newWindowsArray[i].winObject.closed) {
if (newWindowsArray[i].name == kmServiceLineDT) {
kmWindowCounter = 0;
closeAllWindows();
return false;
} else if (newWindowsArray[i].name != "ignore") {
// decrement b/c associated DT popup was closed
newWindowsArray[i].name = "ignore";
kmWindowCounter --;
}
}
}
return true;
}
return false;
}
function openKM(winURL) {
var winFeatures = "width=1024,height=760,left=3000,top=3000,scrollbars=yes,location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes";
var kmName = "KM";
if (winURL.indexOf("forward=isetdtree")>0) {
// Decision tree
serviceLineDT = true;
kmName = kmServiceLineDT;
}
if (checkNewPopup(winURL)) {
if (serviceLineDT) {
if (kmWindowCounter == 2) {
alert("You already have three other browsers open");
} else {
if (kmName != kmServiceLineDT) {
kmWindowCounter ++;
kmName = kmName + kmWindowCounter;
} else {
closeAllKMWindows();
kmWindowCounter = 0;
}
openWindow(winURL, kmName, winFeatures);
}
} else {
closeAllKMWindows();
openWindow(winURL, kmName, winFeatures);
}
} else {
if (kmName == kmServiceLineDT) {
alert("Claim Research solution viewer window is already open");
} else {
alert("A KM solution viewer is already open.");
}
}
}
function addKMComments(commentsInbound) {
if (opener && !opener.closed) {
return opener.addKMComments(commentsInbound);
} else {
alert("ISET has been closed. This popup will be closed on clicking ok.");
self.close();
}
}
function checkNewPopup(winURL) {
if (newWindowsArray.length==0) return true;
for (i=0;i<newWindowsArray.length;i++)
{
if (newWindowsArray[i].URL == winURL && (newWindowsArray[i].name != "ignore" && newWindowsArray[i].name != "KM")) return false;
}
return true;
}
function popUpWindow (winName, windowObject, winURL)
{
this.name = winName;
this.winObject = windowObject;
this.URL = winURL;
}
// function to call in parent window when opening a window
function openWindow(winURL, winName, winFeatures)
{
// create a new window object using the input parameters from user
var newWindow = window.open(winURL, winName, winFeatures);
// create new popUpWindow object passing in the newly created
// window object's name as the first input parameter and the object
// itself as the second parameter
var win = new popUpWindow(winName, newWindow, winURL);
//populate the next index of the window array
newWindowsArray[newWindowsArray.length] = win;
// call focus() for the window object incase the window
// has already been created (you cannot create a window with
// the same name twice)
if (window.focus) newWindow.focus();
}
function openTceWindow(winURL, winName, winFeatures)
{
tceWindow = window.open(winURL, winName, winFeatures);
}
function closeTceWindow()
{
if (tceWindow && !tceWindow.closed)
closeAllWindows();
}
function openCompareClaimsWindow(winURL, winName, winFeatures)
{
compareClaimsWindow = window.open(winURL, winName, winFeatures);
compareClaimsWindow.focus();
}
function closeCompareClaimsWindow()
{
if (compareClaimsWindow && !compareClaimsWindow.closed)
compareClaimsWindow.close();
}
function openProcRevCodeDetailWindow(winURL, winName, winFeatures)
{
closeProcRevCodeDetailWindow();
procRevCodeDetailWindow = window.open(winURL, winName, winFeatures);
procRevCodeDetailWindow.focus();
}
function refreshProcRevCodeDetailWindow(response)
{
if (procRevCodeDetailWindow && !procRevCodeDetailWindow.closed) {
procRevCodeDetailWindow.refresh(response);
}
}
function closeProcRevCodeDetailWindow()
{
if (procRevCodeDetailWindow && !procRevCodeDetailWindow.closed)
procRevCodeDetailWindow.close();
}
//QStar R27 start
function openaccumWindow(winURL, winName, winFeatures)
{
closeaccumWindow();
accumWindow = window.open(winURL, winName, winFeatures);
accumWindow.focus();
}
function refreshaccumWindow(response)
{
if (accumWindow && !accumWindow.closed) {
accumWindow.refresh(response);
}
}
function closeaccumWindow()
{
if (accumWindow && !accumWindow.closed)
accumWindow.close();
}
//QStar R27 end
function openPharWebWindow(url)
{
closePharWebWindow();
pharWebWindow = window.open(url,'','');
}
function closePharWebWindow()
{
if (pharWebWindow && !pharWebWindow.closed)
pharWebWindow.close();
}
function openDrugPricingToolWindow(url)
{
closeDrugPricingToolWindow();
drugPricingToolWindow = window.open(url,'','');
}
function closeDrugPricingToolWindow()
{
if (drugPricingToolWindow && !drugPricingToolWindow.closed)
drugPricingToolWindow.close();
}
function openPharmacyGoogleMapsWindow(url)
{
closePharmacyGoogleMapsWindow();
pharmacyGoogleMapsWindow = window.open(url,'','');
}
function closePharmacyGoogleMapsWindow()
{
if (pharmacyGoogleMapsWindow && !pharmacyGoogleMapsWindow.closed)
pharmacyGoogleMapsWindow.close();
}
function openFormularyToolWindow(url)
{
closeFormularyToolWindow();
formularyToolWindow = window.open(url,'','');
}
function closeFormularyToolWindow()
{
if (formularyToolWindow && !formularyToolWindow.closed)
formularyToolWindow.close();
}
function openCheckImageWindow(url)
{
closeCheckImageWindow();
checkImageWindow = window.open(url,'','');
}
function closeCheckImageWindow()
{
if (checkImageWindow && !checkImageWindow.closed)
checkImageWindow.close();
}
function openClaimImageWindow(url)
{
closeClaimImageWindow();
claimImageWindow = window.open(url,'','');
}
function closeClaimImageWindow()
{
if (claimImageWindow && !claimImageWindow.closed)
claimImageWindow.close();
}
function openMemberEobImageWindow(url)
{
closeMemberEobImageWindow();
memberEobImageWindow = window.open(url,'','');
}
function closeMemberEobImageWindow()
{
if (memberEobImageWindow && !memberEobImageWindow.closed)
memberEobImageWindow.close();
}
function openProviderEobImageWindow(url)
{
closeProviderEobImageWindow();
providerEobImageWindow = window.open(url,'','');
}
function closeProviderEobImageWindow()
{
if (providerEobImageWindow && !providerEobImageWindow.closed)
providerEobImageWindow.close();
}
function openGoogleMapsWindow(url)
{
closeGoogleMapsWindow();
googleMapsWindow = window.open(url,'','');
}
function closeGoogleMapsWindow()
{
if (googleMapsWindow && !googleMapsWindow.closed)
googleMapsWindow.close();
}
function openDashboardWindow(url)
{
closeDashboardWindow();
dashboardWindow = window.open(url,'Consumer_Dashboard','');
}
function closeDashboardWindow()
{
if (dashboardWindow && !dashboardWindow.closed)
dashboardWindow.close();
}
function closeAllImageWindows()
{
closeCheckImageWindow();
closeClaimImageWindow();
closeMemberEobImageWindow();
closeProviderEobImageWindow();
}
function closeExternalWindows()
{
closeDrugPricingToolWindow();
closePharWebWindow();
closePharmacyGoogleMapsWindow();
closeFormularyToolWindow();
closeGoogleMapsWindow();
closeDashboardWindow();
}
function closeAllKMWindows()
{
// Loop through the array and try to identify the window in question
for(i=0; i<newWindowsArray.length; i++)
{
if (!newWindowsArray[i].winObject.closed) newWindowsArray[i].winObject.close();
}
newWindowsArray.length = 0;
}
// Close EFS window named "OHFS_App_Window"
function closeEFSWindow()
{
var winFeatures = "width=512,height=384,left=3000,top=3000,scrollbars=yes,location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes";
var efsWindow = window.open("", "OHFS_App_Window", winFeatures);
if (efsWindow)
efsWindow.close();
}
// function to call in parent document when closing a window
// Pass in the name of the window you want to close as the
// input parameter.
function closeAllWindows()
{
closeAllKMWindows();
// doesn't work due to different domain for EFS windows
//closeEFSWindow();
if (tceWindow && !tceWindow.closed)
tceWindow.close();
closeCompareClaimsWindow();
closeProcRevCodeDetailWindow();
closeaccumWindow();
closeAllImageWindows();
closeExternalWindows();
}
</script>
<body>
Please do not close this popup. This popup controls the KM popups. Closing this window would close all KM popups. If you closed this popup and then click a KM icon, you will get a Javascript error. Please ignore that error and click the KM icon again for the solution viewer to show.
</body>
</html>
Code of the main popup window: [HTML custom control]
<HTML>
<HEAD>
<SCRIPT type="text/javascript">
<%
ClipboardPage parentPage = tools.getActive().getParentPage();
String KanaURL = parentPage.getString("KanaUrl");
%>
var kmLauncher;
var SVCKMUrl = "<%=KanaURL%>";
function openKMWindow(winURL) {
popupKMLauncher();
var r = confirm('Please click on OK to view PMG Details');
if(r==true){
kmLauncher.openKM(winURL);
}
else{ window.close();}
}
function popupKMLauncher() {
var pxReqURL = '<pega:reference name="pxRequestor.pxReqURI"/>';
var request = pxReqURL + "?pyActivity=UHG-Data-Party-Provider.CallKMlauncher";
kmLauncher = window.open(request, "Test",'width=400,height=400,top=3000,left=3000,scrollbars=yes,location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes');
}
</SCRIPT>
</HEAD>
<BODY>
<button type = "button" onclick = openKMWindow(SVCKMUrl)> Launch PMG Details </button>
</BODY>
</HTML>
CallKmLauncher activity has a Show-HTML step with the HTMLStream name as 'kmLauncher', the name of the background popup window.
Note: the No stream to display error occurs in one env but not in the other. Could it be something related to the Policy server config issues in accessing one application from the other?