Tuesday, October 9, 2018

How to call another page on click on a button in OAF and pass the parameters from one page to another

Hello Friends,

Today I am going to tell you how to call another page on click on a button in OAF and pass the parameters from one page to another.

Step1 : Create a page with an item "Message Choice" as item style and give ID as "OrgCode". and create a submit button and  give ID as Submit in item property.

(You can choose any item style as per your requirement)

Step3 : Create a controller and write the below code in ProcessFormRequest Method.

  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
      OAApplicationModule am = pageContext.getApplicationModule(webBean);
               if (pageContext.getParameter("Submit") != null)
                {  
      String strOrgCode = pageContext.getParameter("OrgCode");
           pageContext.forwardImmediately("OA.jsp?OAFunc=RAC_PLANNED_HOURS&OrgCode="+strOrgCode,
           null,
           OAWebBeanConstants.KEEP_MENU_CONTEXT,
           null,
           null,
           true, // retain AM
           OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
           }
  }

 

No comments:

Post a Comment