ADF Basics: Tip for not showing record in dependent lov

Sharing is Caring

Hello All

Recently I have seen a question on OTN forum – Question on cascading LOV

It was about cascading lovs in ADF
Suppose we have 2 dependent LOVs and requirement is that 2nd lov should not show any data until first one is selected , this is very simple and common use case but for beginners it’s a tedious task

So I thought to write it here to help others

Let’s see how to implement this

Here I am using Employees and Departments viewObject to create LOVs and Employees lov is dependent on Departments . I have a dual VO where I have to apply these LOVs

Hope you all know how to create a LOV 🙂
Created two LOVs on EmpId and DeptId

 

Now to make Employees Lov dependent on Departments, created a view Cirteria in EmployeesVO to filter Employees list using selected DepartmentId

and then pass bind variable value from view accessor to filter employees list using selected Department Id

Now run and check application module, You can see by default all Employees appears if you don’t select a Department

Now requirement is to not show any employee until a department is selected, To do this go to Employees ViewObject and Open view criteria and select viewCritieriaItem tag in xml source and change this property

Set GenerateIsNullClauseForBindVars to false to check that if there is null value in bind var then data will not be filtered

After changing XML source is this

<ViewCriteriaItem
        Name="DepartmentId"
        ViewAttribute="DepartmentId"
        Operator="="
        Conjunction="AND"
        Value=":BindDeptId"
        IsBindVarValue="true"
        Required="Optional"
        GenerateIsNullClauseForBindVars="false"/>

Now run and check application module again

dependent lov


Cheers 🙂 Happy Learning

Related Posts

I’m an Oracle ACE, Blogger, Reviewer,
Technical Lead working on Oracle ADF

0 thoughts on “ADF Basics: Tip for not showing record in dependent lov”

  1. Dear Ashish,

    Could you please help me to add a barcode scanner in my app in jdeveloper.

    I have downloaded the barcodeScanner-Master.zip and extracted the folder and put in src folder in ApplicationController.

    But on adding the plugin , it says "Selected directory does not contain a plugin"

    Please help me on this

  2. Hi,
    Is it possible to make all emp list visible when user didnt select dept(i.e. when bind variable is null or empty), that is by default show all the records in emp lov when page loads first, and when user select deptid then show only employees from the selected department.

    Thanks in advance!

  3. Hi,

    But when i want to filter based on the dept selected? how do I achieve that.

    Basically, when selected dept is null, show all records, but when user selects dept, then filter the employee lov with only that dept employees.

    Any suggestions?

    Thanks,

Leave a Reply

Your email address will not be published. Required fields are marked *