4 Replies Latest reply: May 4, 2011 6:06 AM by Braj Pratap RSS

    javaScript function not executed

    833116
      Hi all
      I have created a function in javaScript
      oapagecontext.putJavaScriptFunction("callMethod","function callMethod() {alert(\\\"JavaScript in Action \\\\n\\\");}");
      now I want to call that method
      in pr() of co

      I have written
                       String javaS = "javascript:callMethod();";
                       OAButtonBean orgat = (OAButtonBean)oawebbean.findChildRecursive("clearBtn");
                       orgat.setOnClick(javaS);
      but noting is happening after click on that button
        • 1. Re: javaScript function not executed
          Braj Pratap
          Hi ,

          Pls check these blogs ,see if these can help u .

          http://mukx.blogspot.com/2007/07/javascript-in-oa-framework.html

          http://mukx.blogspot.com/2008/07/disable-browser-back-button-in-oaf.html.


          Thanks
          Pratap
          • 2. Re: javaScript function not executed
            833116
            hi Braj Pratap
            its working
            I have written following code in processRequest()
                              String s="function callMethod() {_moveItems('StatusShuttle:trailing','StatusShuttle:leading');}";
                    oapagecontext.putJavaScriptFunction("callMethod",s);
                             String javaS = "javascript:callMethod();";
                    String strResetShuttles = "_moveAllItems('OrgShuttle:trailing','OrgShuttle:leading');";
                             OAButtonBean orgat = (OAButtonBean)oawebbean.findChildRecursive("clearBtn");
                             orgat.setOnClick(javaS);
            that code is to move items from trailing shuttle to leading shuttle

            when I go to page and click on button then it moves item trailing to leading okay its fine

            but after search then i click on that button it gives an message
            "select item to move" even items are already there in trailing
            if I click on that trailing shuttle and then click on button at that time it moves


            how can I fix it?
            • 3. Re: javaScript function not executed
              833116
              Hey
              any one answer plz!!!
              • 4. Re: javaScript function not executed
                Braj Pratap
                Hi ,

                I am little surprised that you are using the code in PR method ,as per my understanding u shud use this code in PFR method after performing the search ,can u try the same code in PFR method ??


                Thanks
                Pratap