Create A Page in OAF
Create A Page in OAF
Select the pageLayout region of EmployeePG and assign the properties as below
ID : PageLayoutRN
AM Definition : xxhci.oracle.apps.custom.LabExamples.server.XxhciOafTrngEmpTabAM
Window Title : Employee Window
Title: Employee
Warn About Change: True
Step 4: Add items to Create Employee Page
Create a region under PageLayoutRN and assign ID as PageButtonsRN.
Set the region style as pageButtonBar
Now we need to create two buttons in this region as APPLY and CANCEL.
For Apply Button:
Right click on PageButtonsRN > New > Item.
Set the properties as
ID :Apply
Item Style :submitButton
Attribute Set : /oracle/apps/fnd/attributesets/Buttons/Apply
Additional Text :Click to save the transaction
Action Type: fireAction
Event: Apply
For Cancel Button:
Right click on PageButtonsRN > New > Item.
Set the properties as
ID : Cancel
Item Style : submitButton
Attribute Set :/oracle/apps/fnd/attributesets/Buttons/Cancel
Additional Text : Click to cancel the transaction
Action Type: fireAction
Event: Cancel
For text items in page: Right click on PageLayoutRN New Region using wizard. Enter data
as shown in below screenshots
Step 4.1: Select AM and VO instance created during search page
Step 4.2: Give Region ID as MainRN and Region Style as defaultSingleColumn
{ super.create(attributeList);
setEmpNo(employeeId.toString()); }
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OADialogPage;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
OAApplicationModule am =
pageContext.getApplicationModule(webBean);
am.invokeMethod("createEmployee");
} else {
pageContext.redirectToDialogPage(dialogPage);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
// and committed.
if (pageContext.getParameter("event").equalsIgnoreCase("Apply")) {
OAViewObject vo =
(OAViewObject)am.findViewObject("XxhciOafTrngEmpTabEOView1");
String employeeName =
(String)vo.getCurrentRow().getAttribute("EmpName");
String employeeNum =
(String)vo.getCurrentRow().getAttribute("EmpNo");
am.invokeMethod("apply");
MessageToken[] tokens =
OAException confirmMessage =
pageContext.putDialogMessage(confirmMessage);
pageContext.forwardImmediately("OA.jsp?
page=/xxhci/oracle/apps/custom/labExamples/webui/EmpSearchPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
else if (pageContext.getParameter("event").equalsIgnoreCase("Cancel")) {
am.invokeMethod("rollbackEmployee");
pageContext.forwardImmediately("OA.jsp?
page=/xxhci/oracle/apps/custom/labExamples/webui/EmpSearchPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
Step 7: Save all and Run the EmpSearchPG to test the page
Flow Diagram
The Final Output: