1 Reply Latest reply: Nov 29, 2012 12:05 AM by Prabodh RSS

    How to call userdefined java script function in Oracle Forms 11g.

    Sridhar 1245
      Hi,

      I Created a java script contain a function, that will open and close the browser for some URL.

      CODE:-(webclose.jp)
      *function manageWindows() {*
      var windows = [], i = 0;
      var url =  "htttp://oracle:64578/xmlpserver/login.jsp?Go&id=admin&passwd=admini";
      *if (url.length) {*
      *windows[i] = window.open(url, ' tabWindow_'+i);*

      i++;
      *}*
      *winows[i-1].close();*
      *delete windows[i-1];*
      return false;
      *}* Then i placed the javascript file in path <middleware_home>\user_projects\domains\<domain>\servers\WLS_FORMS\_WL_user\formsapp_11.1.1\e18uoi\war\

      After that i called the javascript function in to forms as
      WEB.JAVASCRIPT_EVAL_EXPR('webclose.manageWindows();');
      When running the form it showing error
      FRM-92190: JavaScript is unable to evaluate expression.

      If anybody knows pls help me.
        • 1. Re: How to call userdefined java script function in Oracle Forms 11g.
          Prabodh
          Always post code snippets in &#123;code&#125; tags as explained in the FAQ.
          I Created a java script contain a function, that will open and close the browser for some URL.
          CODE:-(webclose.jp)
          function manageWindows() {
          var windows = [], i = 0;
          var url = "htttp://oracle:64578/xmlpserver/login.jsp?Go&id=admin&passwd=admini";
          if (url.length) {
          windows = window.open(url, ' tabWindow_'+i);
          
          i++;
          }
          winows[i-1].close();
          delete windows[i-1];
          return false;
          } 
          Then i placed the javascript file in path <middleware_home>\user_projects\domains\<domain>\servers\WLS_FORMS\_WL_user\formsapp_11.1.1\e18uoi\war\

          After that i called the javascript function in to forms as
          WEB.JAVASCRIPT_EVAL_EXPR('webclose.manageWindows();');
          When running the form it showing error
          FRM-92190: JavaScript is unable to evaluate expression.

          If anybody knows pls help me.>

          This error has nothing to do with Forms, it is an JavaScript error.
          Most likely cause is this line
          if (url.length) {
          url.length returns a Whole number and so the conditions would be
          if (url.length > 0) {
          Or
          if (url) {  // not null check
          Cheers,