Showing posts with label click image. Show all posts
Showing posts with label click image. Show all posts

Thursday, September 17, 2015

Oracle Application Framework | Create Popup window


How to add popup window in OA Framework.

1) Create Image bean on your page or region.
    Lets say you have created Image bean having id DetailsIMG

2) Create a page or region that you want to open as a popup.

3) Add following code in process request method of main page's controller.

 /** Opening the popup
      */
          OAImageBean img = (OAImageBean) webBean.findChildRecursive("DetailsIMG");
          String url = "/xxtst/oracle/apps/per/selfservice/job/webui/XxTstPG";
//          String Popupparams = "P_OrderNo={@OrderNo}&P_EmpCi={@EmpCi}";
        
//          String page = url + "&retainAM=Y&fndOAJSPinEmbeddedMode=y" + "&" + Popupparams;
          String page = url + "&retainAM=Y&fndOAJSPinEmbeddedMode=y";
          String destURL = OAWebBeanConstants.APPS_HTML_DIRECTORY + OAWebBeanConstants.APPLICATION_JSP + "?" + OAWebBeanConstants.JRAD_PAGE_URL_CONSTANT + "=" + page;
        
          OABoundValueEmbedURL jsBound = new OABoundValueEmbedURL(img, "openWindow(self, '", destURL, "' , 'longTipWin', {width:750, height:450}, true); return false;");
        
          img.setAttributeValue(OAWebBeanConstants.ON_CLICK_ATTR, jsBound);

4) To close the popup add link bean or button on popup page or region and add below code on Destination URI property.

javascript:opener.submitForm('DefaultFormName',0,{XXX:' abc'});window.close();

Note: You can pass parameters also to main page.