Open OAF page with parameters from Hyperlink in OAF

Scenario: Open a page as a popup window and pass parameters to page

  1. Create a link item in main page
  2. Develop a new page that need to be displayed when we click on link
  3. Do the below code in Process Request method of respective controller java file
    1. Get the table bean
    2. Get the link item bean
    3. Prepare the page URL and pass the parameter to page
      1. In this case, @CustomerNumber is nothing but the another attribute in the view object of main page and passing the same as parameter to the page so that it can be used to execute the view object of new page that need be displayed as a popup winnow
    4. Prepare the JavaScript embed URL that need to assigned to hyperlink
    5. Assign the URL to link item

      public void processRequest(OAPageContext pageContext, OAWebBean webBean) {

         super.processRequest(pageContext, webBean);

         OAApplicationModule searchTrxAM = pageContext.getApplicationModule(webBean);         

         OATableBean searchTrxTable = (OATableBean)webBean.findChildRecursive("SearchResultsRN");

         OALinkBean orderNumberLink = (OALinkBean)searchTrxTable.findIndexedChildRecursive("OrderNumber");

         String errorPage = "/xx/oracle/apps/xx/CustomerTrxUI/webui/CustomerPG&CustNum={@CustomerNumber}";

         String destinationURL = APPS_HTML_DIRECTORY + OAWebBeanConstants.APPLICATION_JSP + "?"+ OAWebBeanConstants.JRAD_PAGE_URL_CONSTANT+ "=" + errorPage;

         OABoundValueEmbedURL orderNumberJsWindow = new OABoundValueEmbedURL(orderNumberLink,"javascript:var win = '", destinationURL, "' , 'win', 'height=600,width=1000,left=80,top=250,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes'); win.focus();");

         orderNumberLink.setAttributeValue(oracle.cabo.ui.UIConstants.ON_CLICK_ATTR, orderNumberJsWindow);         



No comments:

Post a Comment