Monday, November 26, 2012

Calling a Processing Page in OAF

Here is a Sample Code Snippet for Calling a Processing page in oaf

if (pageContext.getParameter("ProcessBtn") != null)
    {
      OAProcessingPage page =
      new OAProcessingPage("xxx.oracle.apps.po.component.webui.xyzProcessingCO");
      page.setApplicationModuleDefName("xxx.oracle.apps.po.component.server.xyzAM");
      page.setRetainAMValue(false);
      page.setConciseMessage("This Will Submit Concurrent Program");
      //This Message will be displayed on the Processing Page as s short Message.
      page.setDetailedMessage("This Will Submit Concurrent Program To Load GL Exchange Rates For
selected Setting:"+Settingid);
     //This will be displayed on the Processing Page as a Detailed Message.
      page.setProcessName("Concurrent Program is Runing! please do not close this window");
     //This will be displayed on the Processing Page as a Processing Message.
      pageContext.forwardToProcessingPage(page);
     }
 

This Code should be in the Controller from which we are calling the Processing Page
==========================================
Code in the Controller of processing Page 

In this case  xyzProcessingCO

public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("xxxxxxx");
   //just invoke Some method that you want to use in Processing Page
  //Just after completion of the method Processing page will redirect to the Page which is provided below
    pageContext.forwardImmediately
                                                           (FullQualifiedPagepath,
                                                                                         null,
             OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                                                                         null,
                                                                                         null,
                                                                                         true,
         OAWebBeanConstants.ADD_BREAD_CRUMB_YES);
    throw new OAException (message,OAException.INFORMATION);
    //This message will be appered on the Orginal page after redirecting to it
   }


1 comment:

Unknown said...

There is an error in your example.

The code you mentioned in xyzProcessingCO should be in the processFormRequest() method instead on prcessRequest().