8 Replies Latest reply: May 22, 2013 7:36 AM by Md. Zahid Khan RSS

    How to set parameter to a button programatically

    Md. Zahid Khan
      Hi,

      We have a requirement to open an OAF Page using click of a button. Page1 is having the button (added via Personalizationwith Destination URI set as OA.jsp?page=/oracle/apps/asn/common/customer/webui/CtctUpdatePG) and on click of the button Page 2(CtctUpdate) should open.

      Controller code governing the button has been extended, where we are passing the parameters in PR of the code.

      In our 11i enviroment, it is working perfectly, but in R12 environment, there is an addition of parameter to the existing list of parameters.

      Now, I've got to pass one extra variable 'UPDATE_ACCESS' which we should get from the previous page parameter 'ASNReqFrmCustAcsMd', but its displaying null. Hence, we are hard-coding the value as '1OllOl11O'. But the below approach doesn't seems to work.

      The complete Controller code is as follows:

      import java.io.Serializable;
      import java.sql.ResultSet;
      import java.sql.SQLException;
      import java.sql.Types;
      import oracle.apps.fnd.common.VersionInfo;
      import oracle.apps.fnd.framework.OAApplicationModule;
      import oracle.apps.fnd.framework.webui.OAControllerImpl;
      import oracle.apps.fnd.framework.webui.OAPageContext;
      import oracle.apps.fnd.framework.webui.beans.OAWebBean;
      import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
      import oracle.apps.fnd.framework.webui.beans.layout.OARowLayoutBean;
      import oracle.apps.fnd.framework.webui.beans.layout.OAMessageComponentLayoutBean;
      import oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean;
      import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
      import com.sun.java.util.collections.HashMap;
      import oracle.apps.fnd.framework.OAFwkConstants;
      import oracle.cabo.ui.UIConstants;
      import oracle.cabo.ui.action.FireAction;
      import oracle.jbo.common.Diagnostic;
      import oracle.jdbc.OracleResultSet;
      import oracle.jdbc.OracleCallableStatement;
      import oracle.apps.fnd.framework.server.OADBTransaction;
      import oracle.apps.fnd.framework.OAViewObject;
      import oracle.apps.ar.hz.components.party.relationship.webui.HzPuiUpdateRelationshipCO;
      import oracle.apps.fnd.framework.OAException;
      import oracle.jbo.server.DBTransaction;


      public class HzPuiUpdateRelationshipCOEx extends HzPuiUpdateRelationshipCO
      {
      public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
      {
      super.processRequest(oapagecontext, oawebbean);
                
      OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);          
      String UPDATE_ACCESS = "1OllOl11O"; // declartion of new parameter
                
      //oapagecontext.putParameter("ASNReqFrmCustAcsMd", "UPDATE_ACCESS");
                
      String RelPartyId= oapagecontext.getParameter("HzPuiUpdateRelRelationshipId");
      int RelParentPartyId = Integer.parseInt(oapagecontext.getParameter("HzPuiUpdateRelParentPartyId"));
      oapagecontext.writeDiagnostics(this," Rel Relationship ID : "+RelPartyId +" parent Party ID "+RelParentPartyId,4);
      OAViewObject vo = (OAViewObject)oaapplicationmodule.findViewObject("HzPuiEditRelationshipVO");
      OADBTransaction transaction = oaapplicationmodule.getOADBTransaction();

      String subjectId = null;
      String partyId = null;
      String object_id = null;
      String url = null;
      String Stage = null;

      try
      {

      OracleCallableStatement stmt = null;
      ResultSet rs = null;

      Stage = "Phrasing SQL Query";

      String sql = "SELECT HR.subject_id ";
      sql = sql + ",HR.object_id ";
      sql = sql + ",HR.party_id ";
      sql = sql + ",HR.relationship_id ";
      sql = sql + ",HCP.contact_point_type";
      sql = sql + ",email_address as email";
      sql = sql + ",PHONE_NUMBER ";
      sql = sql + " FROM hz_relationships HR";
      sql = sql + ",hz_contact_points HCP";
      sql = sql + " WHERE HR.party_id = HCP.owner_table_id(+)";
      sql = sql + " AND HR.relationship_id = "+RelPartyId ;
      sql = sql + " AND HR.subject_id = " + RelParentPartyId;
      sql = sql + " AND HCP.primary_flag(+)='Y'";
      sql = sql + " AND HCP.STATUS(+)='A'";

      stmt = (OracleCallableStatement) transaction.createCallableStatement(sql,DBTransaction.DEFAULT);
      oapagecontext.writeDiagnostics(oapagecontext,"SQL Stmt : "+sql,4);

      Stage = "Executing the Query ";
      rs = stmt.executeQuery(sql);
      Stage = "Looping through the result set ";
      while (rs.next()){
      Stage = "Fetching Subject ID and party id ";
      subjectId = rs.getString("subject_id");
      partyId = rs.getString("party_id");
      object_id = rs.getString("object_id");

      }
      rs.close();
      }
      catch (SQLException se)
      {
      oapagecontext.writeDiagnostics(oapagecontext,"SQL Error"+se,4);
      throw new OAException(" Unexpected Sql Error @"+Stage+ " "+se);
      }
      catch (Exception se)
      {
      oapagecontext.writeDiagnostics(oapagecontext,"SQL Error"+se,4);
      throw new OAException(" Unexpected Error @"+Stage+ " "+se);
      }

      OAButtonBean xxUpdtCtct = (OAButtonBean)(oapagecontext.getRootWebBean().findChildRecursive("xxeF783UpdateCtct"));
           
      url="OA.jsp?page=/oracle/apps/asn/common/customer/webui/CtctUpdatePG&xxeModule=F783&ASNReqFrmRelId=";
      url=url+RelPartyId;
      url=url+"&ASNReqFrmRelPtyId="+partyId+"&ASNReqFrmCtctId="+RelParentPartyId;
      url=url+"&ASNReqFrmCustAcsMd="+UPDATE_ACCESS; // we are adding new paramater here
      url=url+"&ASNReqFrmCustId="+object_id;
      url=url+"&retainAM=Y&addBreadCrumb=N";

      oapagecontext.writeDiagnostics(oapagecontext," URL "+url,4);
      xxUpdtCtct.setDestination(url);

      }
           
           public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
      {
      super.processFormRequest(oapagecontext, oawebbean);
      }
      }

      Morevoer, we've also used oapagecontext.putParameter("ASNReqFrmCustAcsMd", "UPDATE_ACCESS");
      but it didn't worked too.

      Kindly provide an approach to pass the new parameter in Page2 URL using click of a button.

      Regards,
      Zahid

      Edited by: mkhan3112 on Apr 25, 2013 4:50 AM

      Edited by: mkhan3112 on Apr 25, 2013 5:02 AM
        • 1. Re: How to set parameter to a button programatically
          Md. Zahid Khan
          By applying the above approach, I'm getting the NPE Error on the click of button. Detail is as follow:

          ## Detail 0 ##
          java.lang.NullPointerException
               at oracle.apps.ar.hz.components.contact.server.HzPuiContactAMImpl.initQuery(HzPuiContactAMImpl.java:158)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:597)
               at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:190)
               at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:153)
               at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:762)
               at oracle.apps.ar.hz.components.contact.webui.HzPuiContactComponentCO.customProcessRequest(HzPuiContactComponentCO.java:134)
               at oracle.apps.ar.hz.components.base.webui.HzPuiBaseCO.processRequest(HzPuiBaseCO.java:159)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:600)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean.processRequest(OAHeaderBean.java:391)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.layout.OACellFormatBean.processRequest(OACellFormatBean.java:411)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.layout.OARowLayoutBean.processRequest(OARowLayoutBean.java:347)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:350)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAFlexibleContentHelper.processRequest(OAFlexibleContentHelper.java:504)
               at oracle.apps.fnd.framework.webui.beans.OAFlexibleContentBean.processRequest(OAFlexibleContentBean.java:356)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.beans.layout.OAFlexibleCellLayoutBean.processRequest(OAFlexibleCellLayoutBean.java:359)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.beans.layout.OAFlexibleRowLayoutBean.processRequest(OAFlexibleRowLayoutBean.java:358)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.beans.layout.OAFlexibleLayoutBean.processRequest(OAFlexibleLayoutBean.java:357)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:350)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1182)
               at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
               at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2620)
               at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1940)
               at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:543)
               at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:431)
               at OA.jspService(_OA.java:212)
               at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
               at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:390)
               at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
               at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
               at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
               at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
               at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
               at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
               at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:642)
               at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
               at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:911)
               at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
               at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
               at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
               at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
               at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
               at java.lang.Thread.run(Thread.java:662)
          java.lang.NullPointerException
               at oracle.apps.ar.hz.components.contact.server.HzPuiContactAMImpl.initQuery(HzPuiContactAMImpl.java:158)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:597)
               at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:190)
               at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:153)
               at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:762)
               at oracle.apps.ar.hz.components.contact.webui.HzPuiContactComponentCO.customProcessRequest(HzPuiContactComponentCO.java:134)
               at oracle.apps.ar.hz.components.base.webui.HzPuiBaseCO.processRequest(HzPuiBaseCO.java:159)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:600)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.layout.OAHeaderBean.processRequest(OAHeaderBean.java:391)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.layout.OACellFormatBean.processRequest(OACellFormatBean.java:411)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.layout.OARowLayoutBean.processRequest(OARowLayoutBean.java:347)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:350)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAFlexibleContentHelper.processRequest(OAFlexibleContentHelper.java:504)
               at oracle.apps.fnd.framework.webui.beans.OAFlexibleContentBean.processRequest(OAFlexibleContentBean.java:356)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.beans.layout.OAFlexibleCellLayoutBean.processRequest(OAFlexibleCellLayoutBean.java:359)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.beans.layout.OAFlexibleRowLayoutBean.processRequest(OAFlexibleRowLayoutBean.java:358)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.beans.layout.OAFlexibleLayoutBean.processRequest(OAFlexibleLayoutBean.java:357)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:350)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1182)
               at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:968)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:935)
               at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:659)
               at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:252)
               at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
               at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2620)
               at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1940)
               at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:543)
               at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:431)
               at OA.jspService(_OA.java:212)
               at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
               at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:390)
               at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
               at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
               at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
               at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
               at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
               at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
               at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:642)
               at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
               at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:911)
               at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
               at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
               at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
               at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
               at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
               at java.lang.Thread.run(Thread.java:662)


          I'm not sure how to proceed now. Kindly help.

          Regards,
          Zahid
          • 2. Re: How to set parameter to a button programatically
            Peddi
            Below approach might avoid the problem
            1) As you are already writing code to handle the button, don't set Destination URI to the button. Remove it.
            2) You should not set any parameters in processRequest. It has to be done in processFormRequest.
            3) Catch the button event in processFormRequest, set the parameters and forward to the new page.

            Regards,
            Peddi.
            • 3. Re: How to set parameter to a button programatically
              Md. Zahid Khan
              Hi Peddi,

              Thanks for the reply.

              Going by your suggestion, below is my observation:

              As you are already writing code to handle the button, don't set Destination URI to the button. Remove it.

              I've tried using setForwardURL() and forwardImmediately() with correct Parameters, but it doesn't seem to work. Hence, I'm left with Destination URI. Can you suggest me any other alternative?

              You should not set any parameters in processRequest. It has to be done in processFormRequest

              Catch the button event in processFormRequest, set the parameters and forward to the new page.

              If you look at the code in PR, sql is executing with paramters derived from getParamter. I'm unable to use the PFA in PFR because we are not able to capture the paramters at PFR.
              It is diplaying IntergerParseInt error at line int RelParentPartyId = Integer.parseInt(oapagecontext.getParameter("HzPuiUpdateRelParentPartyId")); since value is not being able to caputured at PFR request.

              P.S. The extended controller is not the page controller. Page controller is the standard controller. The extended controller is set to 'Default Single Column' in the page. But the code is scripted in PR, hence it is firing at page1 load itself. Moreover, this above code is working in 11i. But not in R12.

              Any other code alternatives please? Kindly help!

              Many Thanks,
              Zahid
              • 4. Re: How to set parameter to a button programatically
                Md. Zahid Khan
                Any suggestions please?

                Thanks,
                Zahid
                • 5. Re: How to set parameter to a button programatically
                  Abdul Wahid
                  Zahid brother,

                  if there are issues in passing paramter from one page to another, then please try this alternate approach.

                  1. Extend the second page controller's processRequest method.
                  2. in this extended method.... write like this...
                  pageContext.setParameter(ASNReqFrmCustAcsMd,"your value"); //Please verify if the method is setParameter or put parameter
                  super.processRequest()...

                  Same replied to your email.

                  Abdul Wahid
                  • 6. Re: How to set parameter to a button programatically
                    Md. Zahid Khan
                    Abdul Wahid bhai,

                    I've also tried adding the code in extended Controller of page2 as follows:

                    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
                    {
                    oapagecontext.putParameter("ASNReqFrmCustAcsMd","1OllOl11O");
                    super.processRequest(oapagecontext, oawebbean);
                    ....


                    But is also leading to the same initQuery error (as mentioned in above error stack).

                    Whereas, for adding more details to the issue,

                    The complete URL for page2 in R12 is as follows: http://ENV_URL/OA.jsp?page=/oracle/apps/asn/common/customer/webui/CtctUpdatePG&xxeModule=F783&ASNReqFrmRelId=49966540&ASNReqFrmRelPtyId=54830871&ASNReqFrmCtctId=316859&ASNReqFrmCustId=31321783&ASNReqFrmCustAcsMd=1OllOl11O&retainAM=Y&addBreadCrumb=N&_ti=280360021&oapc=28

                    +&ASNReqFrmCustAcsMd=1OllOl11O above is causing NPE error+

                    THe URL for page2 in 11i environment *(which is working)* is as follows: http://ENV_URL/OA.jsp?page=/oracle/apps/asn/common/customer/webui/CtctUpdatePG&xxeModule=F783&ASNReqFrmRelId=49966540&ASNReqFrmRelPtyId=54830871&ASNReqFrmCtctId=316859&ASNReqFrmCustId=31321783&retainAM=Y&addBreadCrumb=N&_ti=1615327729&oapc=15

                    Regards,
                    Zahid Khan
                    • 7. Re: How to set parameter to a button programatically
                      SasiKasyap
                      On click of button it goes to PFR

                      if("onClick".equals(pageContext.getParameter(Event_PAram)))
                      {
                      // get the value of button using bean and check the value using sop
                      if its giving desired value

                      // set the destination URI to other page pass the parameters using hashmap and check

                      }

                      regards
                      SasiKasyap .
                      • 8. Re: How to set parameter to a button programatically
                        Md. Zahid Khan
                        Hi All,

                        Thanks eveyone for the prosperous input. I've managed to redirect the page on a button click.

                        The updated code snippet is as follows:

                        String UPDATE_ACCESS = "1O11O111O";

                        url="OA.jsp?page=/oracle/apps/asn/common/customer/webui/CtctUpdatePG&xxeModule=F783&ASNReqFrmRelId=";
                        url=url+RelPartyId;
                        url=url+"&ASNReqFrmRelPtyId="+partyId+"&ASNReqFrmCtctId="+RelParentPartyId;
                        url=url+"&ASNReqFrmCustId="+object_id;
                        url=url+"&ASNReqFrmCustAcsMd="+UPDATE_ACCESS; The new parameter in R12
                        url=url+"&retainAM=Y&addBreadCrumb=N";

                        Regards,
                        Zahid

                        Edited by: Md. Zahid Khan on May 22, 2013 5:36 AM