Wicket
  1. Wicket
  2. WICKET-4905

PagingNavigation: possible to call setStartIndex() earlier than onBeforeRender?

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 6.2.0
    • Fix Version/s: 6.13.0, 7.0.0-M1
    • Component/s: wicket
    • Labels:

      Description

      PagingNavigation has two actions in its onBeforeRender implementation:

      setDefaultModel(new Model<Integer>((int)Math.max(Integer.MAX_VALUE, pageable.getPageCount())));
      setStartIndex();

      Building my own PagingNavigation extending PagingNavigation, not being able to retrieve the start index before onBeforeRender, forces me to put a lot of logical code into my own onBeforeRender implementation.
      So there's a valid workaround, but I'd expect this to work from onConfigure also, maybe even from onInitialize.

      As far as I can see it should be possible to call the two methods earlier than onBeforeRender, however I might be missing the "big picture" and oversee some side effects this could cause.

        Activity

        Peter Parson created issue -
        Martin Grigorov made changes -
        Field Original Value New Value
        Description PagingNavigator has two actions in its onBeforeRender implementation:

        setDefaultModel(new Model<Integer>((int)Math.max(Integer.MAX_VALUE, pageable.getPageCount())));
        setStartIndex();

        Building my own PagingNavigation extending PagingNavigation, not being able to retrieve the start index before onBeforeRender, forces me to put a lot of logical code into my own onBeforeRender implementation.
        So there's a valid workaround, but I'd expect this to work from onConfigure also, maybe even from onInitialize.

        As far as I can see it should be possible to call the two methods earlier than onBeforeRender, however I might be missing the "big picture" and oversee some side effects this could cause.

        PagingNavigation has two actions in its onBeforeRender implementation:

        setDefaultModel(new Model<Integer>((int)Math.max(Integer.MAX_VALUE, pageable.getPageCount())));
        setStartIndex();

        Building my own PagingNavigation extending PagingNavigation, not being able to retrieve the start index before onBeforeRender, forces me to put a lot of logical code into my own onBeforeRender implementation.
        So there's a valid workaround, but I'd expect this to work from onConfigure also, maybe even from onInitialize.

        As far as I can see it should be possible to call the two methods earlier than onBeforeRender, however I might be missing the "big picture" and oversee some side effects this could cause.

        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Fix Version/s 6.13.0 [ 12325564 ]
        Fix Version/s 7.0.0 [ 12322958 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Peter Parson
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development