在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);
}