I just did a cursory review but aren't we missing, with this new version, the total number of records?
Jacopo On May 10, 2013, at 9:48 AM, Hans Bakker <[email protected]> wrote: > that is why i logged it as: > > simplify and fix error: list always empty > > Regards, > Hans > > > > On 05/10/2013 02:21 PM, Adrian Crum wrote: >> The point I was trying to make is this: Since Delegator.findList calls >> Delegator.find, this patch is unnecessary. >> >> The only thing you really changed is this: >> >> + findOpts.setOffset(lowIndex); >> >> the rest of the patch is pointless. >> >> -Adrian >> >> On 5/10/2013 7:16 AM, Hans Bakker wrote: >>> Thank you for your comment, Adrian >>> >>> dif Committed revision 1480891. >>> >>> Regards, >>> Hans >>> >>> On 05/09/2013 06:24 PM, Adrian Crum wrote: >>>> Delegator.findList calls Delegator.find, so I think the problem lies >>>> somewhere else. >>>> >>>> If you look carefully at your patch, you might spot where it is. >>>> >>>> -Adrian >>>> >>>> On 5/9/2013 10:42 AM, Hans Bakker wrote: >>>>> Currently there is a problem in the findshipping screen at: >>>>> https://localhost:8443/facility/control/FindShipment, the list is empty >>>>> although there are shipments. >>>>> >>>>> When i replace the delegator.find with a delegator.findList it works >>>>> again. >>>>> The code gets smaller however i can imagine the delegator.find is used in >>>>> other places? >>>>> >>>>> could it be caused by the recent refactoring? >>>>> >>>>> the diff to replace find with findList: >>>>> Index: >>>>> applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy >>>>> =================================================================== >>>>> --- >>>>> applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy >>>>> (revision 1480573) >>>>> +++ >>>>> applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy >>>>> (working copy) >>>>> @@ -132,25 +132,15 @@ >>>>> 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 @@ >>>>> // 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; >>>> >>> >> >
