Sorting: TransientVO Vs Query/EO based VO

In ADF, you can do a sorting on VO rows by invoking setSortBy("VOAttrName") API, but the tricky part is that, this API actually appends a clause to VO query at runtime and the actual sorting is performed after doing VO.executeQuery(), this goes fine for Query/EO based VO. But, how about the transient VO, wherein the rows are populated programmatically..?

There is a way to it..:)

you can actually specify the query mode on your transient VO, so that the sorting happens on already populated VO rows.

Here are the steps to go about it..

//Populate your transient VO rows.
//VO.setSortBy("YourVOAttrName");
//VO.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
//VO.executeQuery();

So, here the executeQuery() is actually the trigger which calls for VO rows sorting.
QUERY_MODE_SCAN_VIEW_ROWS flag makes sure that the sorting is performed on the already populated VO cache.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Talk on ADF (Mail To: vijay.x.mohan@oracle.com)

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today