7 Replies Latest reply: Jun 24, 2013 12:45 PM by bharat-oracle RSS

    Popup message using java script alert

    bharat-oracle

      Hi,

       

        I am trying to get a pop message in my OAF page once I click on a button (save), I can see the popup message only if there is an exception in my page or if I keep my java script code in processRequest, could anyone please help me know if there is a way that we can achieve the popup message through processformrequest?

       

      Note: I can see the popup message when I write the code in processformrequest only when there is an exception on the page, but normally when there is no exception then I cannot see any popup.

       

      Below is my code in processformrequest

       

      StringBuffer jsString = new StringBuffer();

      jsString.append(" function validatePage() { ");

      jsString.append(" alert('Hello ');");

      jsString.append(" } ");

       

       

      OABodyBean bB = (OABodyBean)oapageContext.getRootWebBean();

      bB.setOnClick(jsString.toString());

      oapageContext.putJavaScriptFunction("validatePage", jsString.toString());

       

      OASubmitButtonBean okButton = (OASubmitButtonBean)oawebBean.findChildRecursive("Save");

      okButton.setOnClick("validatePage()");

       

       

      Thanks,

      Bharat