Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1086

Extending PagingNavigator for stateless pages

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.0-beta4
    • 1.3.0-rc1
    • None
    • 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); }

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            jdpatterson John Patterson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: