You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2014/01/21 22:08:21 UTC

[jira] [Closed] (OFBIZ-5497) last index for paging is not calculated correctly

     [ https://issues.apache.org/jira/browse/OFBIZ-5497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-5497.
----------------------------------

       Resolution: Fixed
    Fix Version/s: Release Branch 13.07
                   Release Branch 12.04
                   SVN trunk
                   Release Branch 11.04

Thanks Gareth,

Your patch is in 
trunk r1560176  
R13.07 r1560182
R12.04 r1560183
R11.04 r1560184 (partly, not all files concerned)

Few notes: 
* when you provide a patch don't forget to pusht the "Provide Patch" button (easier fo researches)
* I wondered if it was related with OFBIZ-5372 but they are not really related. This reminds me that I want to excerpt the paginationControls macros, to refactor them, to have only one, and to use it included, kinda wishful thinking...

> last index for paging is not calculated correctly
> -------------------------------------------------
>
>                 Key: OFBIZ-5497
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5497
>             Project: OFBiz
>          Issue Type: Bug
>          Components: ALL COMPONENTS
>    Affects Versions: SVN trunk
>            Reporter: Gareth Carter
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: Release Branch 11.04, SVN trunk, Release Branch 12.04, Release Branch 13.07
>
>         Attachments: last_index.patch
>
>
> The last index (used on the last button) is not calculated correctly in ftl or the renderer classes. It currently users floor which works only for list sizes that are not multiples of the view size. When you have a list size which is a multiple of the view size, it does not subtract 1 for zero based index and therefore the last button goes to the last page + 1
> Examples
> listSize = 1
> viewSize = 10
> listSize / viewSize = 0.1
> floor(0.1) = 0
> This one produces the correct value
> listSize = 20
> viewSize = 10
> listSize / viewSize = 2
> floor(2) = 2
> Last index should be 1 because of zero based index but never occurs
> To reproduce, enter a view with a list and paging functionality, the list size must be a multiple of the view size



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)