Scenario: Open a page as a popup window and pass parameters to page
- Create a link item in main page
- Develop a new page that need to be displayed when we click on link
- Do the below code in Process Request method of respective controller java file
- Get the table bean
- Get the link item bean
- Prepare the page URL and pass the parameter to page
- 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
- Prepare the JavaScript embed URL that need to assigned to hyperlink
- 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 = window.open( '", 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