Login
Register

Home

Trainings

Fusion Blog

EBS Blog

Authors

Contact Us

OA Framework - All Articles
  • Register

Oracle Gold Partners, our very popular training packages, training schedule is listed here
Designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new Click here to raise Support Ticket. Get reply within 48 hours.

Search Courses

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

In day to day OAF requirements, you might across a situation wherein you need to show a page loaded with data based on some condition. It does not make sense to redirect to the second page and then a provide a return link to the first page. In such cases popup window is the ideal solution. Below are the step by step details on launching a javascript popup window from an OAF screen.

Requirement: To open popup window from an OAF screen

Step 1: Create a new OA workspace and OA project

Create a OA workspace with file name as: Popup

Create a OA project with file name as: Popup

Default package: oaf.oracle.apps.fnd.Popup

Once your project is created, double click on Popup project and select Project content.

Click on 'Add' button next to the bottom pane in the Project content and select only that package which you want have in your project.

Click OK and save your project. 

 Step 2: Create a ADF Business component - Application Module AM

Right click on Popup project -> click New -> select ADF Business components -> select Application Module

Package: oaf.oracle.apps.fnd.popup.server

AM Name: PopupAM

Check Application Module Class: PopupAMImpl Generate Java File(s)

Step 3: Create a OA Components page

Right click on Popup project -> click New -> select OA components under Web Tier -> select Page

Package: oaf.oracle.apps.fnd.popup.webui

Page Name: PopupParentPG

Step 4: Set Page properties

Select on the PopupParentPG page and go to structure pane where a region of type 'pageLayout' and ID 'region1' is automatically created.

Click on region1 in structure page and set the project properties as in the below screenshot - set all the properties except the controller class, for now.

page_properties_popup_article8.png

Step 5: Set new Controller

Select PageLayoutRN in the structure pane -> Right click on it -> Set new controller

Package: oaf.oracle.apps.fnd.popup.webui

Controller name: PopupParentCO

This automatically sets the controller class property in PopupParentPG page properties

We have created CO to capture a button event which launches the popup window

Step 6: Create a button

Select PageLayoutRN in the structure pane -> Right click on it -> New -> Item

Item ID -> button

Item Style -> submitButton

Prompt -> Open Popup

Step 7: Create popup screen

Right click on Popup project -> click New -> select OA components under Web Tier -> select Page

Package: oaf.oracle.apps.fnd.popup.webui

Page Name: PopupPG

Step 8: Set Page properties

Select on the PopupPG page and go to structure pane where a region of type 'pageLayout' and ID 'region1' is automatically created.

Click on region1 in structure page and set the project properties as in the below screenshot - set all the properties except the controller class, for now.

popup_page_properties_popup_article8.png

Step 9: Set new Controller

Select PageLayoutRN in the structure pane -> Right click on it -> Set new controller

Package: oaf.oracle.apps.fnd.popup.webui

Controller name: PopupCO

Step 10: Create a text element

Select PageLayoutRN in the structure pane -> Right click on it -> New -> Item

Item ID -> text

Item Style -> staticStyledText

Step 11: Capture button click event in PopupParentCO

Add the code in the following Process Form Request Function in your PopupParentCO as below

 

     if(pageContext.getParameter("button")!=null){

         String url ="/oaf/oracle/apps/fnd/popup/webui/PopupPG";

         

         //retain am parameter

         String amMode ="true";

         

         //additional parameters to be passed to pop up page

         String param1 = "Hello ";

         String param2 = "World!";

         

         String params="param1="+param1+"&param2="+param2;

 

         //Computing page_url

         String page = url + "&retainAM=" + amMode + "&fndOAJSPinEmbeddedMode=y" + "&" + params;

         

         //Computing final url

         String destURL = OAWebBeanConstants.APPS_HTML_DIRECTORY + OAWebBeanConstants.APPLICATION_JSP + "?" + OAWebBeanConstants.JRAD_PAGE_URL_CONSTANT + "=" + page;

                                

         String javascript = "var a = window.open('"+destURL+"', 'a','height=400,width=400,status=yes,toolbar=no,menubar=no,location=no'); a.focus();";

                              

         pageContext.putJavaScriptFunction("javascript",javascript);

     }

Step 12: Get parameters in PopupCO

Add the code in the following Process Request Function in your PopupCO as below

 

   String param1 = pageContext.getParameter("param1"); //get passed parameters

   String param2 = pageContext.getParameter("param2");

   

   OAStaticStyledTextBean text = (OAStaticStyledTextBean)webBean.findChildRecursive("text");

   text.setText(pageContext,param1+param2);

Result:

On page load:

result_parent_on_load_popup_article8.png

 

On button click a window pops up.

 


Roopa jetR

Comments   

0 #1 Balasubramanian G 2015-06-23 09:38
Hi,

The initial page is working fine for me. If i click on the button, I am getting an error ''You have insufficient privileges for the current operation. Please contact your System Administrator." . Please help me what would be the issue.
Quote
0 #2 Neelan 2015-08-23 06:54
Hi Balasubramanian

Set the below profile.

1) FND_VALIDATION_ LEVEL - None
2) FND_FUNCTION_VA LIDATION_LEVEL - None
Quote
0 #3 mradula 2015-12-11 08:47
javascript:var a =window.open('/ OA_HTML/OA.jsp? page=/bvppa/ora cle/apps/pa/pro mis/forecast/we bui/BVPActualsP G&ProdOffcNum={ @ProductionOffi ceNumber}&ProjI d={@ProjectId}& FirmBudgetId={@ FirmBudgetId}&F irm=Yes&BudgetI d={@BudgetId}&r etainAM=Y&fndOA JSPinEmbeddedMo de=y¶m1=Hel lo ¶m2=World!' , 'a','height=400 ,width=800,stat us=yes,toolbar= no,menubar=no,l ocation=no'); a.focus();
Quote
0 #4 mradula 2015-12-11 08:48
hi Mukul

I am opening a pop up page on a button click using javascript. Passing VO attributes in the URL. but when am fetching in the CO of the pop up page i get null values.
javascript:var a =window.open('/ OA_HTML/OA.jsp? page=/bvppa/ora cle/apps/pa/pro mis/forecast/we bui/BVPActualsP G&ProdOffcNum={ @ProductionOffi ceNumber}&ProjI d={@ProjectId}& FirmBudgetId={@ FirmBudgetId}&F irm=Yes&BudgetI d={@BudgetId}&r etainAM=Y&fndOA JSPinEmbeddedMo de=y¶m1=Hel lo ¶m2=World!' , 'a','height=400 ,width=800,stat us=yes,toolbar= no,menubar=no,l ocation=no'); a.focus();

am able to fetch calue for only one attribute - FirmBudgetId.
for the rest of the attributes am getting null values. i have set the values in the CO of the base page.
Quote

Add comment


Security code
Refresh

About the Author

Roopa jetR

Roopa jetR is an budding OAF developer.

LinkedIn contact: https://www.linkedin.com/in/roopajetR

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Jun 2021  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
   1  2  3  4  5  6
  7  8  910111213
14151617181920
21222324252627
282930    

Enquire For Training

Related Items

Fusion Training Packages

Get Email Updates


Powered by Google FeedBurner