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);
}
微信公众号:
Randy的技术笔记
如果您认为阅读这篇博客让您有些收获,不妨点击一下右下角的【推荐】
如果您希望与我交流互动,欢迎关注微信公众号
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。