Follow by Email

Monday, 20 March 2017

ADF Basics: Tip for not showing record in dependent lov


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


Cheers :) Happy Learning

4 comments :

  1. awesome tip!!!. Thanks you. Good job.

    ReplyDelete
  2. Thanks you so much , I was wondering

    ReplyDelete
  3. 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

    ReplyDelete