ADF中遍历VO中的行数据(Iterator)

在ADF中VO实质上就是一个迭代器,

1.在Application Module的实现类中,直接借助VO实现类和Row的实现类

 TestVOImpl organizationUser = (TestVOImpl) this.getTestVO1();
 while(organizationUser.hasNext()){
         TestVORowImpl   userRow =(TestVORowImpl) organizationUser.next();
}

2.在Application Module的实现类中,按照行数来遍历

 ProcessTaskVOImpl processTaskVO = this.getProcessTaskVO1();
 Row[] processTaskRowSet = processTaskVO.getAllRowsInRange(); //
 for(int i=0,rowSetSize=processTaskRowSet.length;i<rowSetSize;i++){
      ProcessTaskVORowImpl processTaskRow =(ProcessTaskVORowImpl) processTaskRowSet[i];
}

3.在Manage bean中遍历

BindingContext bindingContext = BindingContext.getCurrent();
BindingContainer bindingContainer = bindingContext.getCurrentBindingsEntry();
DCBindingContainer dcb = (DCBindingContainer)bindingContainer;
DCIteratorBinding serviceLogIterator = dcb.findIteratorBinding("ServiceLogPolicyVO1Iterator");
ServiceLogPolicyVOImpl vo = (ServiceLogPolicyVOImpl) serviceLogIterator.getViewObject();
   for (int i = 0, rowCount = vo.getEstimatedRowCount(); i < rowCount; i++) {
         ServiceLogPolicyVORowImpl serviceRowImpl = (ServiceLogPolicyVORowImpl)vo.getRowAtRangeIndex(i); 
}

 

posted @ 2014-07-03 11:36  骑着龙的羊  阅读(820)  评论(0编辑  收藏  举报