Tuesday, June 3, 2014

Oracle Application Framework (OAF) - Hello World Page

1. Every project should be under a OA Workspace. Right click on Applications and select New OA Workspace.

2. Set the below properties for the workspace:
Workspace Properties
Name – OracleApps88.jws
Add New OA Project – Check it

3. Set the following properties for the project and Click Next.
Project Properties:
Project Name – OracleApps88
Default Package – xxapps88.oracle.apps.fnd.hello
In the Default package xxapps88 is the third party identifier. fnd is the application short name and hello is the component name.

4. For the hello world tutorial there is no database connection required. Click Next.

5. Set the below connection details and Click Next and Finish.
Run Time Connection Details:
DBC File Name - <JDEV_USER_HOME>\dbc_files\secure\<DBC File Name>.dbc
User Name – operations <Application User Name>
Password – welcome < Application Password>
Application Short Name – FND

6. Right click on OracleApps88 and select New.

7. Select the Web Tier OA Components Page.

8. Set the following properties for the page and click OK.
New Page:
Name – Apps88HelloWorldPG
Package – xxapps88.oracle.apps.fnd.hello.webui

9. Click on Apps88HelloWorldPG and in the structure pane and click on region1 and set the following properties for the region:
Region Properties:
Id – PageLayoutRN
AM Definition – oracle.apps.fnd.framework.server.OAApplicationModule
Window Title – Oracle Applications
Page Title – Hello World

10. Right click on PageLayoutRN and select new Region.

11. Set the following properties for the region. All the message type items should be created under messageComponentLayout region style.
Region Properties:
Id – MainRN
Region Style – messageComponentLayout

12. Right click ok MainRN and select new messageTextInput

13. Set the following properties for the messageTextInput:
MessageTextInput Properties:
Id – HelloName
Prompt – Name
Maximum Length – 40
Length – 20

14. For creating a Button which will post the value got from the user we need a submit button. Buttons cannot be created under "messageComponentLayout" region. So we will create a messageLayout region and create a new submit Button under it.

15. Right click on MainRN and select new messageLayout.

16. Set the following properties:
MessageLayout Properties:
Id – ButtonLayout

17. Right click on ButtonLayout and select new Item.

18. Set the following properties:
Item Properties:
Id – Go
Item Style – submitButton
Prompt – Go

19. The structure pane for the Apps88HelloWorldPG should look like below:

20. The page design is over now and lets create a controller which will handle the code.

21. Right click on PageLayoutRN and click Set new Controller.

22. Set the following properties for the controller. Click Ok.
Controller Properties:
Package – xxapps88.oracle.apps.fnd.hello.webui
Name – apps88HelloWorldCO

23. Click on Apps88HelloWorldCO.java. The java file contains processFormRequest and processRequest method. For handling the button click request code needs to be written under the processFormRequest method.

ProcessFormRequest Code:
//Checks if the Go button is pressed. If yes then the code will be executed
if (pageContext.getParameter("Go")!=null)
     //Assigns the value of input from the inputText to the string inputName
     String inputName=pageContext.getParameter("HelloName");
     //Concats Hello with the input and then !
     String outmsg="Hello "+"" + inputName + "!!";
     //Throws the concatenated message as an exception information on the browser
     throw new OAException(outmsg,OAException.INFORMATION);

24. Save your work and right click on OracleApps88 project and click Add to Project Content.

25. Click on Add. Select xxapps88 and click Ok. Again Click Ok. Now you should see only the package xxapps88.oracle.apps.fnd.hello.webui in your project.

26. Right click on Apps88HelloWorldPG and click Run. The completed page will
look like below:

No comments:

Post a Comment

Best Blogger TipsGet Flower Effect