How to create LOV
Test case – In this example, I will create a VO on STATEMENT_LINES(BgStatementLinesView). One of attribute of this VO is Budget category_id.I will create another VO on BUDGET_CATEGORY(BgBudgetCategoryView) , this VO has attributes
- Category ID
- Category Name.
Finally I create LOV that will display category Name and category ID and attach that to the category_id attribute of BUDGET_LINES.
Steps
Open Oracle Jdeveloper (Jdev11g).
- Select New application.
- Select the template Fusion Web Application (ADF) and Wizard will help you to create TWO projects.
- Model
- View Controller.
Model is for Data Control and ViewController for UI.
In Model Project Design the Business Services by selecting categories > business tier >ADF Business components >“Business Components from table”.
Pic 1.1
- Complete Database connection Setup.
- Select the BUDGET_LINES and BUDGET_CATEGORIES table and created Entity Object (EO). Then Create VO budgetlinesVOI and budgetcategoryVO finally create Application Module (AM)
- Creation of Application Model will exposed our VO to client, and they will appear under Data Control.
- Save your Work.
Pic 1.2
In ViewController Project open adfc-config.xml and drag a JSF page component by dragging View from Component palette. Save your work
- Open the page and save it as budgetlov.jspx. (Please note that this is unbounded task flow).
- Open BgStatementLilnesView.xml and Select View Accessor and then select ADD (+).
- Add BudgetCategory VO (bgBudgetCategoryView1) to BudgetStatementLines VO by moving bugetcategory VO from “Available View Objects “ to “View Accessors” as shown in Pic1.1
Go to the attributes of the BgStatementLilnesView.xml (STATEMENT LINES vo) select the attribute where you want attach LOV (in my case it is CategoryId).
5. Double click the attribute.
6. Select List of Values (in Serach) and then Check the check box “Enable List of values”, it will highlight the category view “BgBudgetCategoryView1” , double click the category ID (because we want to build LOV on category ID , as category_id column exists in both the Vos).
7. Go to “Go to UI Hints” tab
8. Set Default List Type = Combo box with List of valies and Include Search region = All Queryable Attributes
9. Now if we have “All Query able attribute” in Include Search region , then in the LOV we will see a search block which allow us to search based on all the fields of category table
On the other hand , if we have requirement to show only few fields in LOV , we can go to Budget Category VO and define a View criteria.
as we have selected 3 fields here and save and let’s go back to LOV again.
Now we can see only view criteria that we have created in previous step in “Include Search region.“
Save and Run Form again
If we define the column in “Selected” then we will able to query all those in View criteria , but able to see all column that appear in “Selected”
Now If we change Default List Type to Choice List
There are no comments yet.