For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.
User, tell us your jdev version, please!
Well, it's one way to do it (and not too bad). However, it always depends on hte use case. The method used in the blog allows you to navigate back and forth and holds all rows in memory. If you only want to visit each row, but don't plan to navigate (other than forward), you can use an optimized VO where you set the navigation in the VO to 'forward only'. Then for larger row sets page ranging is a better alternative as only one page of rows are read into memory.
Timo
Hi, Timo.
Thanks for reply.
My jdev is 11.1.1.7.
My use case is "copy" view object data to other adf table. Which approach should I use?
This is my not working code:
public void copyPayrolls1(ActionEvent actionEvent){ DCIteratorBinding prlInfoIter = ADFUtils.findIterator("PayrollInfoIterator"); DCIteratorBinding prlVOIter = ADFUtils.findIterator("PayrollVO1Iterator"); RowSetIterator prlInfoRowSet = prlInfoIter.getRowSetIterator(); ViewObject vo = prlVOIter.getViewObject(); vo.executeQuery(); while (vo.getRowSet().hasNext()) { Row newRow = prlInfoRowSet.createRow(); newRow.setAttribute("payrollName",vo.getCurrentRow().getAttribute("PayrollName")); newRow.setAttribute("legalName",vo.getCurrentRow().getAttribute("LegalName")); newRow.setAttribute("payrollID",vo.getCurrentRow().getAttribute("PayrollId")); prlInfoRowSet.insertRow(newRow); System.out.println("asd"); } prlInfoRowSet.closeRowSetIterator(); }
public void copyPayrolls1(ActionEvent actionEvent){
DCIteratorBinding prlInfoIter = ADFUtils.findIterator("PayrollInfoIterator");
DCIteratorBinding prlVOIter = ADFUtils.findIterator("PayrollVO1Iterator");
RowSetIterator prlInfoRowSet = prlInfoIter.getRowSetIterator();
ViewObject vo = prlVOIter.getViewObject();
vo.executeQuery();
while (vo.getRowSet().hasNext()) {
Row newRow = prlInfoRowSet.createRow();
newRow.setAttribute("payrollName",vo.getCurrentRow().getAttribute("PayrollName"));
newRow.setAttribute("legalName",vo.getCurrentRow().getAttribute("LegalName"));
newRow.setAttribute("payrollID",vo.getCurrentRow().getAttribute("PayrollId"));
prlInfoRowSet.insertRow(newRow);
System.out.println("asd");
}
prlInfoRowSet.closeRowSetIterator();
Thanks
You can do it the way you coded it, if the number of rows to copy is small. For bigger row sets I would use a special VO whihc uses range paging amd only forward navigation.