Thursday, August 25, 2016

How To: Redirect to a new page in OAF

The method pageContext.setForwardURL() is to redirect to a new page. There are several ways in which the method can be used in your controller class:

Option 1:

 //Create HashMap to include destination page parameters
 HashMap hm = new HashMap();
 hm.put("poNumber",poNumber);
 hm.put("pMode","createMemo");

 //Forward to destination page
 pageContext.setForwardURL(
  "OA.jsp?page=/xxcc/oracle/apps/ar/demo/webui/myDemoPG", // Path to the destination page
  null,  // No need to specify with KEEP_MENU_CONTEXT
  OAWebBeanConstants.KEEP_MENU_CONTEXT, // No change in the menu context. Keep same as source page 
  null,  // No need to specify with KEEP_MENU_CONTEXT
  hm,  // HashMap with page parameter
  true,  //Retain AM state.
  OAWebBeanConstants.ADD_BREAD_CRUMB_YES, //Show breadcrumbs
  OAWebBeanConstants.IGNORE_MESSAGES //Ignore any messages
 ); 

Please share your feedback below. Hope you find this helpful!

CaptiveCode

No comments:

Post a Comment