You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2012/05/18 11:17:53 UTC

[1/2] git commit: WICKET-4555

Updated Branches:
  refs/heads/master 700d716b8 -> 1f1ab0c8d


WICKET-4555

Move pagingNavigation's initialization in PagingNavigator#onInitialize() instead of using the old !(hasBeenRendered()) approach.


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/1f1ab0c8
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/1f1ab0c8
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/1f1ab0c8

Branch: refs/heads/master
Commit: 1f1ab0c8d8738d9cce288ec9cbd11e45257a8dae
Parents: 97c0a7c
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri May 18 11:14:11 2012 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri May 18 11:17:35 2012 +0200

----------------------------------------------------------------------
 .../html/navigation/paging/PagingNavigator.java    |   37 ++++++--------
 1 files changed, 16 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/1f1ab0c8/wicket-core/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigator.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigator.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigator.java
index b87fdc9..bbd670b 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigator.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigator.java
@@ -81,29 +81,24 @@ public class PagingNavigator extends Panel
 		return pageable;
 	}
 
-	/**
-	 * @see org.apache.wicket.Component#onBeforeRender()
-	 */
 	@Override
-	protected void onBeforeRender()
+	protected void onInitialize()
 	{
-		if (get("first") == null)
-		{
-			// Get the navigation bar and add it to the hierarchy
-			pagingNavigation = newNavigation("navigation", pageable, labelProvider);
-			add(pagingNavigation);
-
-			// Add additional page links
-			add(newPagingNavigationLink("first", pageable, 0).add(
-				new TitleAppender("PagingNavigator.first")));
-			add(newPagingNavigationIncrementLink("prev", pageable, -1).add(
-				new TitleAppender("PagingNavigator.previous")));
-			add(newPagingNavigationIncrementLink("next", pageable, 1).add(
-				new TitleAppender("PagingNavigator.next")));
-			add(newPagingNavigationLink("last", pageable, -1).add(
-				new TitleAppender("PagingNavigator.last")));
-		}
-		super.onBeforeRender();
+		super.onInitialize();
+
+		// Get the navigation bar and add it to the hierarchy
+		pagingNavigation = newNavigation("navigation", pageable, labelProvider);
+		add(pagingNavigation);
+
+		// Add additional page links
+		add(newPagingNavigationLink("first", pageable, 0).add(
+			new TitleAppender("PagingNavigator.first")));
+		add(newPagingNavigationIncrementLink("prev", pageable, -1).add(
+			new TitleAppender("PagingNavigator.previous")));
+		add(newPagingNavigationIncrementLink("next", pageable, 1).add(
+			new TitleAppender("PagingNavigator.next")));
+		add(newPagingNavigationLink("last", pageable, -1).add(
+			new TitleAppender("PagingNavigator.last")));
 	}
 
 	/**