Count number of records in LOV using LOV Accessor

Sharing is Caring
Hello All
This post is about a simple requirement – How to count number of records in  LOV ?
I have seen this type of threads on OTN forum so here I am writing about itWe can make use of LOV Accessor to  count number of records in LOV as per selected source viewObject record, Here I am using Departments and Employees table of Oracle HR Schema

I have created a transient attribute in Department viewObject to show Department wise Employees LOV, To filter Employees ViewObject using Department Id  created a viewCriteria to filter it

Now applied LOV on transient attribute (Created in Departments ViewObject) and passed Department Id in Lov Accessor to filter Employees list


LOV part is done, Now to count number of records in Lov I have added one more transient attribute in Departments viewObject and used LovAccessorName.count(“KeyAttributeName”) to populate transient value, this expression will calculate number of records in LOV as per selected Departments record

Now dropped this viewObject as form on page and see output

Moving to Next Record-

Count number of records in LOV

Now suppose if you want to disable lov when there is no records in list, for this just put a condition on lov component

Cheers 🙂 Happy Learning

Related Posts

An Oracle ACE, Blogger, Reviewer, Technical Lead working on Oracle ADF

Leave a Reply

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