OFBiz
  1. OFBiz
  2. OFBIZ-3194

Quick look are showing pagination renderNextPrev pagination style when list size is greater than 20

    Details

    • Type: Bug Bug
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Trunk
    • Fix Version/s: None
    • Component/s: framework
    • Labels:
      None
    • Sprint:
      Bug Crush Event - 21/2/2015

      Description

      Quick look are showing pagination renderNextPrev pagination style when list size is greater than 20.

      In htmlFormMacroLibrary.ftl below given code snippet is hard-coded. :

      {<#if listSize gt 20>}

      This can be changed to

      {<#if listSize gt viewSize>}

      as viewSize is passed as parameter in macro renderNextPrev. This is also reported by Matthieu Bollot in developer mailing list.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        22m 57s 1 Jacopo Cappellato 13/Nov/09 17:14
        Resolved Resolved Closed Closed
        8s 1 Jacopo Cappellato 13/Nov/09 17:14
        Closed Closed Reopened Reopened
        1d 14h 34m 1 Bruno Busco 15/Nov/09 07:49
        Sharan Foga made changes -
        Rank Ranked higher
        Sharan Foga made changes -
        Rank Ranked higher
        Sharan Foga made changes -
        Rank Ranked higher
        Sharan Foga made changes -
        Sprint Bug Crush Event - 21/2/2015 [ 91 ]
        Jacopo Cappellato made changes -
        Fix Version/s Release Branch 10.04 [ 12314832 ]
        Jacopo Cappellato made changes -
        Assignee Jacopo Cappellato [ jacopoc ]
        Gavin made changes -
        Workflow jira [ 12481985 ] OFbiz Workflow [ 12506833 ]
        Bruno Busco made changes -
        Fix Version/s Release Candidate Branch 10.04 [ 12314832 ]
        Fix Version/s SVN trunk [ 12311928 ]
        Hide
        Jacques Le Roux added a comment -

        Hi Bruno,

        I did not look into details but this look like a good idea, if it does not break anything...
        Also if we could use a default and let the user choice his/her own, as inititally Adrian suggested...

        Show
        Jacques Le Roux added a comment - Hi Bruno, I did not look into details but this look like a good idea, if it does not break anything... Also if we could use a default and let the user choice his/her own, as inititally Adrian suggested...
        Hide
        Bruno Busco added a comment -

        I have seen that in UtilMisc.java there is a Method that retrieves the availableLocales with a public static List<Locale> availableLocales()
        These are in a property like this: locales.available=en,fr,nl

        Should we think to something similar for availableViewSizes ?

        Show
        Bruno Busco added a comment - I have seen that in UtilMisc.java there is a Method that retrieves the availableLocales with a public static List<Locale> availableLocales() These are in a property like this: locales.available=en,fr,nl Should we think to something similar for availableViewSizes ?
        Hide
        Bruno Busco added a comment -

        I retrieved from the ML the original use-case that was causing the problem:

        "It seems that with a view-size less than 20 (eg: 5), and only 19 results (ie between view-size and 20), there will be no prev/next stuff."

        The problem is originated IMO from a view-size that is not in the list of availableViewSizes.

        In this case the property could be something like this:

        widget.form.availableViewSizes=[5, 20, 30, 50, 100, 200];
        widget.form.defaultViewSize = 5;

        and the suggested code will work!

        Show
        Bruno Busco added a comment - I retrieved from the ML the original use-case that was causing the problem: "It seems that with a view-size less than 20 (eg: 5), and only 19 results (ie between view-size and 20), there will be no prev/next stuff." The problem is originated IMO from a view-size that is not in the list of availableViewSizes. In this case the property could be something like this: widget.form.availableViewSizes= [5, 20, 30, 50, 100, 200] ; widget.form.defaultViewSize = 5; and the suggested code will work!
        Bruno Busco made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Hide
        Bruno Busco added a comment -

        Jacques,
        in the renderNextPrev there is an hardcoded list of possible viewSize values; at the moment it is [20, 30, 50, 100, 200].
        The correct change would be IMO:
        1) Have this list specified as a property setting in addition to the actual defaultViewSize (i.e. adding something like widget.form.availableViewSizes = [20, 30, 50, 100, 200]
        2) Replace the value 20 in the comparison (the one that has now been replaced with viewSize) with availableViewSizes[0]

        Doing this we vill have the next/prev rendering in any case the number of the elements in the list is greater of the minimum number of elements the user can select to be shown.

        Is it possible to have a list value for a property? Any pointer to a similar use?
        Does this suggested logic solve the issue that has been reported?

        Show
        Bruno Busco added a comment - Jacques, in the renderNextPrev there is an hardcoded list of possible viewSize values; at the moment it is [20, 30, 50, 100, 200] . The correct change would be IMO: 1) Have this list specified as a property setting in addition to the actual defaultViewSize (i.e. adding something like widget.form.availableViewSizes = [20, 30, 50, 100, 200] 2) Replace the value 20 in the comparison (the one that has now been replaced with viewSize) with availableViewSizes [0] Doing this we vill have the next/prev rendering in any case the number of the elements in the list is greater of the minimum number of elements the user can select to be shown. Is it possible to have a list value for a property? Any pointer to a similar use? Does this suggested logic solve the issue that has been reported?
        Hide
        Jacques Le Roux added a comment -

        Bruno,

        Is this value (20) not dependend of widget.form.defaultViewSize in widget.properties ?

        Show
        Jacques Le Roux added a comment - Bruno, Is this value (20) not dependend of widget.form.defaultViewSize in widget.properties ?
        Hide
        Jacques Le Roux added a comment -

        Then we should reopen, isn'it ?

        Show
        Jacques Le Roux added a comment - Then we should reopen, isn'it ?
        Hide
        Bruno Busco added a comment -

        The value 20 hardcoded was used because it is the minimum of the available viewSize.
        With the change you have done the problem is that when you select, lets say 30 as viewSize, and you have a listSize of 25 there is no way to switch back to viewSize 20 because the pagination is not rendered anymore.

        Show
        Bruno Busco added a comment - The value 20 hardcoded was used because it is the minimum of the available viewSize. With the change you have done the problem is that when you select, lets say 30 as viewSize, and you have a listSize of 25 there is no way to switch back to viewSize 20 because the pagination is not rendered anymore.
        Jacopo Cappellato made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Jacopo Cappellato made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Jacopo Cappellato added a comment -

        Thank you Divesh,

        your code is in rev. 835925

        Jacopo

        Show
        Jacopo Cappellato added a comment - Thank you Divesh, your code is in rev. 835925 Jacopo
        Jacopo Cappellato made changes -
        Assignee Jacopo Cappellato [ jacopoc ]
        Divesh Dutta made changes -
        Component/s framework [ 12311145 ]
        Component/s order [ 12311152 ]
        Divesh Dutta made changes -
        Field Original Value New Value
        Attachment OFBiz-3194.patch [ 12424867 ]
        Hide
        Divesh Dutta added a comment -

        Here is the path for the same.

        Avoiding hard-code value and using viewSize instead. This was blocking to show all the products in "Quick look up" while placing purchase order

        Show
        Divesh Dutta added a comment - Here is the path for the same. Avoiding hard-code value and using viewSize instead. This was blocking to show all the products in "Quick look up" while placing purchase order
        Divesh Dutta created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Divesh Dutta
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development

                Agile