Saturday, January 3, 2015

External LOV in OAF

1. Create a New Workspace and Project

Right Click Applications -> New OA Workspace



Enter Workspace Name and Click OK


Enter Project Name and Default Package then click Next


2. Create a New Application Module

Right Click on ExternalLovProject -> New -> ADF Business Components -> Application Module

Enter Package and Application Module Name then Click Next.



3. Create a New View Object (VO)

Right click on EnternalLovProject -> New -> ADF Business Components -> View Object





VO Select Statement

SELECT project_id projectid,
       segment1 projectnumber,
       name projectname

  FROM pa.pa_projects_all

Click Next till SQL Statement Window. (Step 5 of 8)



Step 4: Attach VO to AM

Right Click on ExternalLovAM -> Edit ExternalLovAM


Data Model -> ExternalLovVO
Update the Name ExternalLovVO1 -> ExternalLovVO
Move to Right then click on OK



5. Create a New OA Page

Right Click on EnternalLovProject -> New -> OA Components -> Page




Name: ExternalLovPG
Package: oracle.apps.fnd.externallov.webui 


Step 6: Create a LOV Region

Right Click on EnternalLovProject -> New -> OA Components -> Region





Attribute
Property
Name
ExternalLovRN
Package
oracle.apps.fnd.externallov.webui
Region Style
listOfValues
Scope
Public




7. Select ExternalLovRN. Right click on ExternalLovRN in Structure pane and click table using wizard. In the wizard choose the oracle.apps.fnd.externallov.server.ExternalLovAM and select the ExternalLovVO.



Region ID: ExternalLovRN

Region Style: table




Move the fields to Right


Click Next and Finish it.



8: Modify the Field Properties



9: Create a New Page Layout Region and Container Region for Lov
Select ExternalLovPG

ID: PageLayoutRN
AM Definition: oracle.apps.fnd.externallov.server.ExternalLovAM
Window Title: External LOV Window
Title: Project LOV

Right click PageLayoutRN and click new Region

ID: MainRN

Region Style: messageComponentLayout

10. Right click the MainRN and click new messageLovInput

ID: ProjectName
External Lov: /oracle/apps/fnd/externallov/webui/ExternalLovRN




11. Lov Mappings

ID: ProjectLovMap
LovRegionItem: ProjectName
ReturnItem: ProjectName
Criteria Item: ProjectName



12. Save your work, Run the ExternalLovPG.xml





Congratulations, you have done it!

Friday, January 2, 2015

Hello World Page


Step 1: Create a New OA Workspace and Project

Go To "Application Navigator" Tab and Right click on "Applications", Select "New OA Workspace"


Enter "OA Workspace Name" and click "OK"


Click "Next"


Enter "Project Name" and "Default Package" and Click "Next"


Check the "Use Repository for Design Time" check box.


Select the DB Connection.


Connection

Browse the DBC File and enter the applications User Name, Password, Application Short Name and Responsibility Key and Click "Next"


Click "Finish"


Step 2: Set Run Options

Select your Project, Right Click on that and select “Project Properties”.



Select “Run Options” under “Oracle Applications”.
Select “OADiagnostic” Move to right and Click “OK”.



Step 3: Create AM (Application Method)

Right click on Project (HelloWorldProject) -> New


Select Business Tier -> ADF Business Components -> Application Module



Click OK and Next



Enter Package Name and Application Method Name



Click Next



Click Next



Click Next



Click Next and Finish



Step 4: Create a Hello World OA Page

Right click on Project (HelloWorldProject) -> New


Web Tier -> OA Components -> Page and Click OK


Enter Page Name and Package



Step 5: Modify Page Layout Regions



Update regoin1 properties

Attribute
Property
ID
PageLayoutRN
Region Style
pageLayout
Form Property
TRUE
Auto Footer
TRUE
Window Title
Hello World Page Window Title
Title
Hello World Page Title
AM Definition
oracle.apps.fnd.helloworld.server.HelloWorldAM


Step 6: Create Region for Text Item, Button Layout & Button

Right click on PageLayoutRN -> New -> Region


Update Region Properties

Attribute
Property
ID
MainRN
Region Style
messageComponentLayout


Step 7: Create Text Input Item

Right Click on MainRN -> New -> messageTextInput


Update Text Input Item Properties

Attribute
Property
ID
UserName
Style Property
messageTextInput
Prompt
User Name
Length
20
Maximum Length
100


Step 8: Create Container Region for Button


Update Region properties

Attribute
Property
ID
ButtonLayout


Step 9: Create Go Button

Right Click on ButtonLayout -> New -> Item


Update Item Properties

Attribute
Property
ID
Go
Item Style
submitButton
Attribute
/oracle/apps/fnd/attributesets/Buttons/Go


Step 10: Add a Controller

Right Click on MainRN -> Set New Controller


Enter Package Name and Controller (Class) Name


Step 11: Edit Controller Java Codes

Add Following OA Exception as a last line in import section

import oracle.apps.fnd.framework.OAException;


Replace processFormRequest code with the following

     public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
     {
            super.processFormRequest(pageContext, webBean);
             if (pageContext.getParameter("Go") != null)
             {
                     String userContent = pageContext.getParameter("UserName");
                     String message = "Hello, " + userContent + "!";
                     throw new OAException(message, OAException.INFORMATION);
             }

     }


Step 12: Save your Work and Run the HelloWorldPG.xml





Congratulations, You have done it!