Friday, March 15, 2013

Enabling Multi Selection in af:query component


In some cases, we might need to allow user to select multiple values while searching data using search functionality. To accomplish this requisite, ADF framework provides a declarative approach. I have given a sample example using HR schema available with XE. Follow the steps mentioned below.

  1.  Create Employees & Departments View Objects
  2. Go to Employees VO attributes section and add LOV to DepartmentId attribute based on values from Departments VO
  3. Go to Employees VO query section and add view criteria For ex ‘EmployeesVOCriteria’
  4. Inside the view Criteria, add DepartmentId attribute. Move to UI Hints tab, under Criteria Item UI Hints section, select DepartmentId, and check ‘Support Multiple Value Selection’. Save.
  5. Go to UI project, add a page, and drag EmployeesVOCriteria as Query Panel into page.
  6. Run the page
k