3 Replies Latest reply: Jul 2, 2014 3:52 PM by jrimblas RSS

    Open new modal window from branch – javascript

    1462501

      Application Express 4.2.3.00.08

       

      I've a branch configured to redirect to URL after a button pressed and some process executed:

        eg. javascript:window.open('http://www.google.com');

       

      It doesnt't work because APEX generate this code like this (ie add server and port to this link):

      http://192.168.72.72:7001/apex/javascript:window.open('http://www.google.com');

       

      I've tried with javascript function:

       

      function PopupCenter(url, title, w, h) {

          var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;

          var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;

                 

          width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;

          height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;

                 

          var left = ((width / 2) - (w / 2)) + dualScreenLeft;

          var top = ((height / 2) - (h / 2)) + dualScreenTop;

          var newWindow = window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);

       

          // Puts focus on the newWindow

          if (window.focus) {

      newWindow.focus();

          }

      }

       

      and call from branch:

      javascript:PopupCenter(&G_REPORT_LINK.,'Detalji narudžbe','640','800');

      It doesnt work.

       

      Whenever I put javascript call in branch URL target, the result is the same: I got an error, and link is as described above.

       

      When I just put the link in URL target, I got result, but I want my window to be modal - in my case I call previously generated report (Oracle Reports) - everything works fine, except the window isnt modal.

      I tried with target="_blank" - doesnt work.

       

      I read many articles on forum about modal window, but didn't find solution.

       

      I used above function for calling a page in application and show that page on modal window - its worked - but this call is make from report, not branch.

       

      Any suggestion, please...

      What I do wrong with javascript call?

       

      Thnx in advance.

       

      Kresimir Perak.