How to Create List of Values (LOV) in Oracle ADF

Create List of Values – LOV in Oracle ADF

In this post i will continue to enhance my previous post’s Employee Form and create my first List of Values (LOV) in Oracle ADF Form. Creation of LOV in ADF is as simple as in Oracle Forms. In this post i am going to create LOV for Department and Job entities. Do the following steps to create LOV in ADF.

1) Add Departments and Jobs Entities
2) Add View Objects for Departments and Jobs LOVs
3) Create LOVs

4) Finally Link LOVs to JSF Page
Right click on adf.demo.model.view in Model project and choose Re-factor than Rename the  adf.demo.model.view to adf.demo.mode.queries for good naming convention.
Adding Departments and Jobs Entities
Right clicking on adf.demo.model.entities package in Model project and choose New Entity Object to Add Departments Entity.
Enter Name as DeptLOV and Choose Schema object as DEPARTMENT
Choose All columns in attributes page and click Finish
Repeat the same step for Jobs entity
Adding View Objects for Departments and Jobs LOVs
Right click on adf.demo.model.queries package and Choose New View Object
Enter name as DeptLOV and Click Next
Select the DeptLOV entity and move to selected area. Uncheck the Updatable option also
Select all Attributes to Selected area
Choose Dept ID in Order by section by pressing EDIT button and Click Finish
Repeat same steps for Jobs LOV
Creating LOVs
Double click EmployeeVO in adf.demo.model.queries section.Select DepartmentId attribute in the attribute page and Click “+” green button at the bottom under List of Values section
Click the green + button with List Data Source. Select DeptLOV in Available Objects change the Name at the bottom to DeptLOVAcesssor and move it to View Accessors to Create LOV
Choose Dept in List Attribute Return Values will populate automatically
Go to UI Hints tab Leave the List type as Choice List . Move DeptName from Available to Selected Area. Choose Labeled Item(First of List)  at very bottom include No Selection..  and set it accordingly
Repeat Same Steps for JobId attribute
Your EmpView page should looks like this
Linking LOVs to JSF Page
Open employee.jspx page in View Controller Project. Delete JobsId and DepartmentId attribute by selection them in Structure Window
Refresh the DataControl page. Expand the Data Control, Select DepartmentsId attribute from EmpView and Drag and Drop it to FormLayout. Menu will appear select  ADF One Choice List from Single Selection
Repeat the same step for JobId and adjust entities accordingly on your AFD Form. Now Finally Right click and Choose Run. Your Page should looks like this on Runtime

About Oracle Technology Blogs
Oracle Application Development

6 Responses to How to Create List of Values (LOV) in Oracle ADF

  1. subash says:

    Make ur image size little bigger.. can’t able to see

  2. Susa@ says:

    Hi Yousuf, nice article, but at least put some good images. Those images are neither visible nor expandable.

    • ok

  3. Pullareddy says:

    Hi ,

    Thanks for posting this.
    One question here is why do we need the entity object for creating LOVs?


  4. as says:

    unable to read screen shots.

  5. Viswa says:

    Hi I need Your Help…I am trying to save files in Jdeveloper it showing Error Like Below…pls share me solution…
    Oracle Error: Unable to save files in Jdeveloper

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: