Integra for Notes Banner
  QuickReports Integra4Notes Integra Family of Products



"The web page you are viewing is trying to close the window. Do you want to close this window?" when running web-enabled Integra profiles


The Integra for Notes database provides a few design elements that have to be inherited into any web-enabled database that is to call web-enabled Integra profiles. When adding the button to launch an Integra profile the following message would appear: "The web page you are viewing is trying to close the window. Do you want to close this window?"



Note: this does happen only when the Notes view or form from which Integra is being called via action button is not residing within a frameset. If framesets are used the problem does not occur.

The cause for this message is some code contained within the form called Integra4WebSelectedDocuments, which is one of the above mentioned design elements to be inherited in Integra web-enabled databases. The onLoad event of this form contains the following java script:

// the code lines in bold (at the end of the code listing) are the involved in causing the problem

function GetCookieValue(cCooking, cStoreName)
{
    var cReturn;

    if ("" == cCooking) return "";
    var nStart = cCooking.indexOf(cStoreName + "=");
    if (-1 == nStart) return "";
    nStart += cStoreName.length + 1;
    var nEnd = cCooking.indexOf(";", nStart);
    if (-1 == nEnd) {
      nEnd = cCooking.length;
    }
    cReturn = cCooking.substring(nStart, nEnd);
    return cReturn;
}

// -------------------------------------------------------
    if (window.opener.opener == null)
      var par = window.opener;
    else
      var par = window.opener.opener;

    var frm = window.document.forms[0];
    var tmp = unescape(par.document.cookie);

    frm.Parameters.value = tmp;
    frm.ProfileName.value = GetCookieValue(tmp,"IntegraProfileName");
    frm.UseCurrentDoc.value = GetCookieValue(tmp,"IntegraCurrentDoc");
    frm.DialogParams.value = GetCookieValue(tmp,"IntegraParams");

    tmp = GetCookieValue(tmp,"IntegraCurrentDoc");

    frm.VwName.value = par.location.pathname + par.location.search;

    if (tmp == "0")
    {
      var app = par.view;
      var args = new Array;
      var cArg = 0;
      var docCtr;
      if (app == null)
      {
        var cb = window.opener.document.forms[0].$$SelectDoc;
        if ((cb.value == null) || (cb.value == ""))
        {
          for (docCtr = 0; docCtr < cb.length; docCtr++)
          {
            if (cb[docCtr].checked)
            {
              args[cArg++] = cb[docCtr].value;
            }
          }
        }
        else
        {
          frm.Docs.value = cb.value;
        }
      }
      else
      {
        var selectedDocs = app.getSelectedDocumentsEx();
        var cSel = selectedDocs.size();
        var id;
        for (docCtr = 0; docCtr < cSel; docCtr++)
        {
          id = selectedDocs.elementAt(docCtr);
          if (getLength(id) == 32)
          { // it's a doc id...
            args[cArg++] = id;
          }
        }
      }
      if (cArg > 0)
      {
        frm.Docs.value = args.join("\n");
      }
    }
    else
    {
      var url = par.location.pathname;
      var docid = url.substr(url.lastIndexOf("/")+1,32);
      frm.Docs.value = docid;
    }

    //Close the Integra dialog window
    //The line in bold is to be remarked
    //window.opener.close();

    frm.SaveOptions.value = "0";

    frm.submit();

    return;

    .




    FAQ# 0130
    Bookmark and Share

     
    QUICK LINKS
     
     

     

      © Shireburn Software Ltd. 2008 - 2024