Here I am posting a step by step tutorial to build a simple CREATE page in OAF. It is a continuation of an earlier tutorial and so you need to go through that first before going through this.

Here is the link: Build Simple Search Page in OAF

Step1: Build a Create Button

  • Select the view EmpSearchPG, right click and select New > TableActions. One region (region1) will be created with region style as ‘FlowLayout’.
  • Change the ID of the above newly created region to ButtonLayoutRN.
  • Right click ButtonLayoutRN and create a new Item.
  • Set the below details for the Item
    • ID :Create
    • Item Style : submitButton
    • Attribute Set: /oracle/apps/fnd/framework/toolbox/attributesets/FwkTbxEmployees/CreateEmployee
    • Action Type: fireAction
    • Event: create

Step 2: Set a Controller

  • Right click PageLayoutRN and select ‘Set New Controller’.
  • Give the package name as ‘xxhci.oracle.apps.custom.LabExamples.webui’.
  • Give the class name as EmpSearchCO.

Add the following logic to processFormRequest of EmpSearchCO.java after super.processFormRequest method.

You might get red lines under java classes which are not imported. Bring the cursor on these red-lined text and click Alt+Enter (JDev automatically tells you to import the class using Alt+Enter when you move cursor over these lines).

Step 3: Build the Create Employee Page (EmployeeCreatePG)

  • Right click on Project >New >Web Tier >OA Components à Page.
  • Set the Page name as EmployeeCreatePG
  • Set the package name as xxhci.oracle.apps.custom.LabExamples.webui
  • 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

Step 4.3: Select attributes as below (EmpNo, EmpName and Department)

Step 4.4: Change the prompts of items as shown below (messageInputText)

Click on finish for step 5.

Change the Region Style for MainRN to messageComponentLayout. This is done now as above region wizard, doesn’t have support for messageComponentLayout. Click on Yes button when the confirm window pops for change of region style.

Step5: Adding Model Layer Code

Add following code to XxhciOafTrngEmpTabAMImpl.java. Add import statements at the start and rest of the methods with the class definition.

Add the following import statement and modify the create method in XxhciOafTrngEmpTabEOImpl as follows:

Add this as a part of import statements

Modify the create method as below

Step6: Add Controller logic for Create Employee Page

Right click on PageLayoutRN of EmployeeCreatePG > Set New Controller.

Give the values as
Package : xxhci.oracle.apps.custom.LabExamples.webui
Class Name : EmployeeCO

Add the below code to the new CO

Import Statements:

processRequest (after super.processRequest):

processFormRequest (after super.processFormRequest):

Step 7: Save all and Run the EmpSearchPG to test the page

Flow Diagram

The Final Output:

Related Posts:

6 Comments

  1. RAJNISH

    Very help full, But can you please help me registering multiple page because I am able to resister first page but when clicking on create button after deployment I am getting error:
    Error:You have insufficient privileges for the current operation. Please contact your System Administrator

Leave a Reply