Implement Dependent LOV in OA Framework
Let us try to create a Dependent LOV. In this exercise first Lov Input is “Employee Name” based on Employee Name Second Lov Input will give “Dependent Name”
1. Create a New Workspace and Project
Right click Workspaces and click create new OAworkspace and name it as PRajkumarDependentLovDemo.
Automatically a new OA Project will be created. Name the project as DependentLovDemo and package as prajkumar.oracle.apps.fnd.dependentlovdemo
Note -- Check Run Option Property for Project.
Right Click on DependentLovDemo > Oracle Applications > Run Options. Check OADeveloperMode should not be inSelected Options if it is there in Selected Options list then shuttle it back to Available Options
2. Create a New Application Module (AM)
Right Click on DependentLovDemo > New > ADF Business Components > Application Module
Name -- DependentLovAM
Package -- prajkumar.oracle.apps.fnd.dependentlovdemo.server
3. Create a New View Object (VO)
Right click on DependentLovDemo > New > ADF Business Components > View Object
Name – DependentLovVO1
Package -- prajkumar.oracle.apps.fnd.dependentlovdemo.server
Note - The VO is not based on any EO so click next and go to the query section and paste the query
SELECT person_id, full_name
FROM per_all_people_f
WHERE SYSDATE BETWEEN effective_start_date AND effective_end_date
FROM per_all_people_f
WHERE SYSDATE BETWEEN effective_start_date AND effective_end_date
4. Create a New View Object for Second Lov (VO)
Right click on DependentLovDemo > New > ADF Business Components > View Object
Name – DependentLovVO2
Package -- prajkumar.oracle.apps.fnd.dependentlovdemo.server
Note - The VO is not based on any EO so click next and go to the query section and paste the query
SELECT pcr.person_id, papf.full_name
FROM per_contact_relationships pcr,
per_all_people_f papf
WHERE papf.person_id = pcr.contact_person_id
AND SYSDATE BETWEEN pcr.date_start AND NVL(pcr.date_end,SYSDATE)
AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
FROM per_contact_relationships pcr,
per_all_people_f papf
WHERE papf.person_id = pcr.contact_person_id
AND SYSDATE BETWEEN pcr.date_start AND NVL(pcr.date_end,SYSDATE)
AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
5. Add Your View Objects to Root UI Application Module
Select Right click on DependentLovAM > Edit DependentLovAM > Data Model >
Select DependentLovVO1 and DependentLovVO2 and shuttle to Data Model list
Create First LOV Region for VO DependentLovVO1
6. Create First LOV Region
Right click on DependentLovDemo > New > Web Tier > OA Components > Region
Name -- FirstLovRN
Package -- prajkumar.oracle.apps.fnd.dependentlovdemo.webui
Region Style -- listOfValues
Scope -- Public
Note - The property Scope is the key property which makes the LOV region public and makes it usable in multiple pages
7. Right click on FirstLovRN and click table using wizard. In the wizard choose the prajkumar.oracle.apps.fnd.dependentlovdemo.server.DependentLovAM and select DependentLovVO1_1. Click Next
Region Id – FirstLovRN
Region style – table
8. Shuttle the two attributes to the right side.That is PersonId and FullName
9. Set Region Item properties as below –
ID
|
Prompt
|
Style
|
Datatype
|
PersonId_LOV
|
PersonId
|
formValue
|
NUMBER
|
FullName_LOV
|
FullName
|
messageStyledText
|
VARCHAR2
|
10. Click Next and Finish
11. Select PersonId_LOV and Set Following Properties –
Attribute
|
Property
|
Search Allowed
|
False
|
Selective Search Criteria
|
False
|
12. Select FullName_LOV and Set Following Properties –
Attribute
|
Property
|
Search Allowed
|
True
|
Selective Search Criteria
|
False
|
Now Same way Create Second LOV Region for VO DependentLovVO2
13. Create Second LOV Region
Right click on DependentLovDemo > New > Web Tier > OA Components > Region
Name -- SecondLovRN
Package -- prajkumar.oracle.apps.fnd.dependentlovdemo.webui
Region Style -- listOfValues
Scope -- Public
Note - The property Scope is the key property which makes the LOV region public and makes it usable in multiple pages
14. Right click on SecondLovRN and click table using wizard. In the wizard choose the prajkumar.oracle.apps.fnd.dependentlovdemo.server.DependentLovAM and select DependentLovVO2_1. Click Next
Region Id – SecondLovRN
Region style – table
15. Shuttle the two attributes to the right side.That is PersonId and FullName
16. Set Region Item properties as below –
ID
|
Prompt
|
Style
|
Datatype
|
Second_PersonId_LOV
|
PersonId
|
messageStyledText
|
NUMBER
|
Second_FullName_LOV
|
FullName
|
messageStyledText
|
VARCHAR2
|
17. Click Next and Finish
18. Select Second_PersonId_LOV and Set Following Properties –
Attribute
|
Property
|
Search Allowed
|
False
|
Selective Search Criteria
|
True
|
19. Select Second_FullName_LOV and Set Following Properties –
Attribute
|
Property
|
Search Allowed
|
True
|
Selective Search Criteria
|
False
|
20. Create a New Page
Right click on DependentLovDemo > New > Web Tier > OA Components > Page
Attribute
|
Property
|
Name
|
DependentLovPG
|
Package
|
prajkumar.oracle.apps.fnd.dependentlovdemo.webui
|
21. Select the DependentLovPG and go to the strcuture pane where a default region has been created
22. Select region1 and set the following properties:
Attribute
|
Property
|
ID
|
PageLayoutRN
|
AM Definition
|
prajkumar.oracle.apps.fnd.dependentlovdemo.server.DependentLovAM
|
Window Title
|
Dependent List of values Demo Window
|
Title
|
Dependent List of values Demo
|
23. Right click PageLayoutRN and click new Region
Attribute
|
Property
|
ID
|
MainRN
|
Region Style
|
messageComponentLayout
|
24. Create a New item to store Return result of First LOV and to give Search Criteria to second LOV
Select PageLayoutRN > New > Item
Set following Properties for New Item –
Attribute
|
Property
|
ID
|
ParentPersonId
|
Item Style
|
formValue
|
Data Type
|
Number
|
Build First LOV on Page:
25. Right click the MainRN and click new messageLovInput
Set Following Properties for Newly Created messageLovInput
Attribute
|
Property
|
ID
|
Employee_Name
|
External Lov
|
/prajkumar/oracle/apps/fnd/dependentlovdemo/webui/FirstLovRN
|
Search Allowed
|
False
|
Selective Search Criteria
|
True
|
Prompt
|
Employee Name
|
Select LovMap1 and set following properties --
Attribute
|
Property
|
Lov Region Item
|
FullName_LOV
|
Return Item
|
Employee_Name
|
Criteria Item
|
Employee_Name
|
Create LovMap2 and set following properties for that --
Select Employee_Name > lovMappings right click New > lovMap
Set following properties for lovMap2 --
Attribute
|
Property
|
Lov Region Item
|
PersonId_LOV
|
Return Item
|
ParentPersonId
|
Build Second LOV on Page:
26. Right click the MainRN and click new messageLovInput
Set Following Properties for Newly Created messageLovInput
Attribute
|
Property
|
ID
|
Dependent_Name
|
External Lov
|
/prajkumar/oracle/apps/fnd/dependentlovdemo/webui/SecondLovRN
|
Search Allowed
|
True
|
Selective Search Criteria
|
True
|
Prompt
|
Dependent Name
|
Select LovMap3 and set following properties --
Attribute
|
Property
|
Lov Region Item
|
Second_FullName_LOV
|
Return Item
|
Dependent_Name
|
Programmatic Query
|
True
|
Create LovMap4 and set following properties for that --
Select Dependent_Name > lovMappings right click New > lovMap
Set following properties for lovMap4 --
Attribute
|
Property
|
Lov Region Item
|
Second_PersonId_LOV
|
Criteria Item
|
ParentPersonId
|
Required
|
True
|
27. Congratulation you have successfully finished. Run Your page and Test Your Work
No comments:
Post a Comment