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