Search This Blog

Saturday, March 19, 2016

14. OAF Calling One Form to Another Form

Calling One Form to Another Form


In this lesson we will see how to call one page from the current page in OAF. To create link between two pages we have “pageContext.serForwardURL”.
First create WorkSpace  and project.
Create AM, create page and attach AM to the page.
Here we are creating VO which displays employee information which are entered using the previous chapter page.
We know that to display data we need to create VO, attach VO to AM and then we need to execute the VO query whenever we click on the button, so there fore for that we need to write the code in the Process Form Request of Controller.
To know how to display data from the data base see the chapter called Displaying Data from DataBase.
 
Let us see  the parameter list in “pageContext.setForwardURL”.
Example code is :

line1 :  pageContext.setForwardURL (DestinationPagePath,
line2:                              null,
line3 :                             menu_context,
line4 :                             null,
line5 :                             params(null),
line6 :                             RetainAM(true),
line7 :                             ADD_Bread_Crumbs,
line8 :                             Ignore_Messages);
 
line1 :- Destination Page Path : Complete path of the OAF page.
line2:- null : If we want to call oracle apps form then then in first line Destination page path is null and here we will give the function name of the form. Line1 and Line2 are interlinked.
line3:- menu_context: We can include any number of menus as we require.
line4:- null: if we want only one particular menu then here we will specify that menu name and in line3 we need to pass null, line3 and line4 are interlinked.
line5: -params(null) : If we want to carry the values then we pass those values here.
line6:- RetainAM(true): generally this will be set to true value.
line7: -Add_Bread_Crumbs: If we want the link to carry to next page and store in the memory.
line8:-Ignore Messages: It will restrict the messages to not to carry from one page to another.

In this chapter we used displaying data of employees information which are entered in Data Entry page of previous lesson, if we want to see the employees information then we need to click on the button “Get Employee Information” and to create a new employee we need to click on “Create Employee” button.
The page structure of the Project what we are using now contains one main region and under it One Table Using Wizard Region, two submit buttons. The following figure shows the page structure:
 
Page Structure of OAF Employee Information

If we run the page after creating VO and executing that VO whenever we click on the “Get Employee Information” then the output looks like the following:
 
Output on OAF to get information from Database

If we observe in the output whenever we click on the Create Employee button it must take us to the Create Employee page which we created and seen in previous lesson.
Whenever we click on the Create Employee button then only it must take us to the Create Employee page so for that we need to write the code in the “processFormRequest”  of controller and the code in processFormRequest is:

[sql]if(pageContext.getParameter(“item3”)!=null)
{
  pageContext.setForwardURL(“OA.jsp?page=/xxapples/oracle/apps/po/insertingrecords/webui/InsertDataPG”,
                            null,
                            OAWebBeanConstants.KEEP_MENU_CONTEXT,
                            null,
                            null,
                            true,
                            OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
                            OAWebBeanConstants.IGNORE_MESSAGES);
}[/sql]
In the program “item3” is the id value of the Create Employee button. When we rebuild the code and run the page then the output looks like the following:

Output to link OAF page to another page

Now after clicking on the Create Employee button it leads us to Create Employee page:

Employee adding page in OAF

1 comment:

  1. How to Call one Page to another Page with Parameters in OAF

    ReplyDelete