ViewObject有多种query mode:ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES,ViewObject.QUERY_MODE_SCAN_VIEW_ROWS
在设置了一种query mode的时候,绑定到RichTable的ViewObject的默认排序可能会失效,我们可以这样操作。
1,在manage bean中添加sort method:
public void sortMethod(SortEvent event){
DCIteratorBinding iter = ADFUtils.findIterator("xxxxVOIterator");
String propery = event.getSortCriteria().get(0).getProperty();
String isAsending =
event.getSortCriteria().get(0).isAscending() == true ? "asc" : "desc";
ViewObject vo = iter.getViewObject();
vo.setSortBy(propery + " " + isAsending);
vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
vo.executeQuery();
vo.setSortBy(null);
//去除排序基准
SortCriteria[] sc = new SortCriteria[0];
iter.applySortCriteria(sc);
}
|
2,在RichTable中添加sort listener
sortListener="#{backing_xxx.sortMethod}"
.....
阅读(1112) | 评论(0) | 转发(0) |