Wicket
  1. Wicket
  2. WICKET-1086

Extending PagingNavigator for stateless pages

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-beta4
    • Fix Version/s: 1.3.0-rc1
    • Component/s: None
    • Labels:
      None

      Description

      I am extending PagingNavigator to use stateless links but have found that the underlying PagingNavigation factory method newPagingNavigationLink() does not let me return a subclass of Link. I have tested the change below and it seems to work OK on my stateless pages.

      Index: /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigation.java
      ===================================================================
      — /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigation.java (revision 585875)
      +++ /Users/John/Development/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigation.java (working copy)
      @@ -17,6 +17,7 @@
      package org.apache.wicket.markup.html.navigation.paging;

      import org.apache.wicket.markup.html.basic.Label;
      +import org.apache.wicket.markup.html.link.Link;
      import org.apache.wicket.markup.html.list.Loop;
      import org.apache.wicket.version.undo.Change;

      @@ -302,7 +303,7 @@
      final int pageIndex = getStartIndex() + loopItem.getIteration();

      // Add a page link pointing to the page

      • final PagingNavigationLink link = newPagingNavigationLink("pageLink", pageable, pageIndex);
        + final Link link = newPagingNavigationLink("pageLink", pageable, pageIndex);
        loopItem.add(link);

      // Add a page number label to the list which is enclosed by the link
      @@ -329,8 +330,7 @@

      • the page index the link points to
      • @return the page navigation link.
        */
      • protected PagingNavigationLink newPagingNavigationLink(String id, IPageable pageable,
      • int pageIndex)
        + protected Link newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { return new PagingNavigationLink(id, pageable, pageIndex); }

        Activity

        Hide
        Igor Vaynberg added a comment -

        patch applied, please attach an impl of a stateless paging navigator so we can add it to core...

        Show
        Igor Vaynberg added a comment - patch applied, please attach an impl of a stateless paging navigator so we can add it to core...

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            John Patterson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development