We have seen the Javascript Popup article on opening and passing parameters onto a OAF page in a popup window. Now, let us see as how to pass parameters on redirection from one page to another.
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: Param
Create a OA project with file name as: Param
Default package: oaf.oracle.apps.fnd.Param
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 Param project -> click New -> select ADF Business components -> select Application Module
Package: oaf.oracle.apps.fnd.param.server
AM Name: ParamAM
Check Application Module Class: ParamAMImpl Generate Java File(s)
Step 3: Create a OA Components page
Right click on Param project -> click New -> select OA components under Web Tier -> select Page
Package: oaf.oracle.apps.fnd.param.webui
Page Name: FirstPG
Step 4: Set Page properties
Select on the FirstPG 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.
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: FirstCO
This automatically sets the controller class property in FirstPG page properties
Step 6: Create a button
Select PageLayoutRN in the structure pane -> Right click on it -> New -> Item
Item ID -> button
Item Style -> submitButton
Prompt -> Go to Page 2
Step 7: Create Second page
Right click on Param project -> click New -> select OA components under Web Tier -> select Page
Package: oaf.oracle.apps.fnd.param.webui
Page Name: SecondPG
Step 8: Set Page properties
Select on the SecondPG 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.
Step 9: Set new Controller
Select PageLayoutRN in the structure pane -> Right click on it -> Set new controller
Package: oaf.oracle.apps.fnd.param.webui
Controller name: SecondCO
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 FirstCO
Add the code in the following Process Form Request Function in your FirstCO as in the below screenshot
HashMap hashMap = new HashMap(); // to put parameters to passed onto 2nd page
hashMap.put("param1","Hello ");
hashMap.put("param2","World!");
if(pageContext.getParameter("button")!=null){
pageContext.setForwardURL("OA.jsp?page=/oaf/oracle/apps/fnd/param/webui/SecondPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
hashMap,
true,
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
}
Step 12: Get parameters in SecondCO
Add the code in the following Process Request Function in your SecondCO as in the below screenshot
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:
On button click - navigates to Second page with parameters:
Comments
which blog platform are you using for this website?
I'm getting sick and tired of Wordpress because I've had
issues with hackers and I'm looking at alternatives for another platform.
I would be fantastic if you could point me in the direction of a
good platform.
Do you have any? Kindly allow me know in order that I may just subscribe.
Thanks.
Is it difficult to set up your own blog? I'm not very techincal but I can figure
things out pretty fast. I'm thinking about setting up my own but I'm
not sure where to begin. Do you have any points
or suggestions? Many thanks
once entirely right. This put up truly made my day.
You cann't imagine just how a lot time I had spent for this information!
Thank you!
RSS feed for comments to this post