Create Simple ADF Form using Oracle JDeveloper 11g
In this post i will show you how to create simple ADF Form using Oracle JDeveloper 11g. I have create simple employee form based on employee table i.e. created in database. Using following steps i have create the form.
1) Create Application and Entity Objects
2) Create View Objects based on entities
3) Linking View Objects with Application Modules
4) Finally Create JSF Page
Pre-requisites
1) Oracle JDeveloper 11g
2) Employee Table in Oracle Database
Create Application and Entity Objects
Open JDeveloper and chose default role.
Choose New Application from Menu.
Enter Application Name MyFistADFApp Application Package adf.demo and Select Fusion Web Application (ADF) in Application Template.
Create Database Connection Screen will open, enter connection name as DBCONN, enter Database username and password and Test connection it should appear Success
Click Right on Model Project choose NEW
select ADF Business Components and choose Business Components from Tables from Items Click OK as shown in the slide
By Default DBCONN Connection will appear Click OK
Choose the Employee table to selected area and rename the Package name to adf.demo.model.entities
On the Application Module Step rename Application Module as HIRSModule and package to adf.demo.model.services click Finish
The above all steps will create the Employee Entity with Application Module in the Model Project
Creating View Object based on Employee Entities
Click Right and choose New on Model Project Choose View Object
Enter View Object Name EmpView change package name to adf.demo.model.view click Next
Move the Employee entity to the selected area and check the updatable option
Move all Fields to the selected area
Click Finish Now Model Project is ready to create ADF Form
Linking View Object with Application Module service
In the Model Project Section Open HIRSModule.xml under adf.demo.model.services and go to Data Model Page
Select EmpView on the Available pane and move it to Data model side under HIRSModule and Save all
Creating JSF page
Right click adfc-config under Page Flow directory in ViewController Project and select Open
Drag & Drop View Activity from component palette named it employee
Double click the employee view activity select Blank Page click OK. Jdeveloper will open one default layout.
Select the EmpView from the Data Controls section
Drag and drop it to employee.jspx page and Choose ADF > ADF Form from the Menu
Select all fields as shown in the slide and check Include Submit Button and Navigation Controls
Your form should appear like this
Click in the structure pane the af:document and set the Title property on the right side the to Employee
Save all and Right click to Choose Run on employee page. That's all Output will be appear on browser.
Comments
Post a Comment