Author: hansbak Date: Fri May 10 06:15:28 2013 New Revision: 1480891 URL: http://svn.apache.org/r1480891 Log: simplify and fix error: list always empty
Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy?rev=1480891&r1=1480890&r2=1480891&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy Fri May 10 06:15:28 2013 @@ -132,25 +132,15 @@ if ("Y".equals(lookupFlag)) { lowIndex = viewIndex * viewSize + 1; highIndex = (viewIndex + 1) * viewSize; findOpts.setMaxRows(highIndex); - + findOpts.setOffset(lowIndex); + if (!orderReturnValue) { - // using list iterator - orli = delegator.find("Shipment", mainCond, null, null, orderBy, findOpts); - - shipmentListSize = orli.getResultsSizeAfterPartialList(); + shipmentList = delegator.findList("Shipment", mainCond, null, orderBy, findOpts, false); + shipmentListSize = shipmentList.size(); if (highIndex > shipmentListSize) { highIndex = shipmentListSize; } - - // get the partial list for this page - if (shipmentListSize > 0) { - shipmentList = orli.getPartialList(lowIndex, viewSize); - } else { - shipmentList = [] as ArrayList; - } - - // close the list iterator - orli.close(); + } if (orderReturnValue) { @@ -202,7 +192,7 @@ if ("Y".equals(lookupFlag)) { // only commit the transaction if we started one... this will throw an exception if it fails TransactionUtil.commit(beganTransaction); } - + context.shipmentList = shipmentList; context.listSize = shipmentListSize; context.highIndex = highIndex;