Monday, October 22, 2012

How to get Filtered Rows in View Object using ADF


Subject :
 If you need to get a collection of rows from a view object based on some filtered criteria, Follow the below solution , To explain in detail For eg : You could have got 100 rows after performing a search on EmployeeROVO , But if you want to get rows from the EmployeeROVO only where employee status equals 'Active' , then you don't need to re query the view object , You can filter the rows from the row set itself

Solution #1


// Status & Qualification - Attribute name        
RowQualifier rq =
          new RowQualifier("Status= '" + row1.getEmpStatus() +
                           "' AND Qualification= '" +
                           row1.getQualification() + "'");

        Row[] rows = empVO.getFilteredRows(rq);

Solution #2

// First parameter is attribute name , Second attribute is value of the attribute that you want to filter
Row[] rows = empVO.getFilteredRows("Status","Active");

3 comments: