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/02/24 08:49:00 UTC
git commit: WICKET-4420 Unversioned pages don't get touched when
created and cannot be found by ID later
Updated Branches:
refs/heads/wicket-1.5.x 19bc50d01 -> f7a7e5576
WICKET-4420 Unversioned pages don't get touched when created and cannot be found by ID later
Non-versioned pages should be touched when created. After that any change in their hierarchy wont increase their id.
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/f7a7e557
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/f7a7e557
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/f7a7e557
Branch: refs/heads/wicket-1.5.x
Commit: f7a7e5576a07c4eb5c0d45535d35cef42e4c137e
Parents: 19bc50d
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu Feb 23 17:48:40 2012 +0100
Committer: martin-g <mg...@apache.org>
Committed: Fri Feb 24 08:48:40 2012 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/wicket/Page.java | 18 ++++++++------
.../org/apache/wicket/settings/IPageSettings.java | 13 +++++++++-
2 files changed, 21 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/f7a7e557/wicket-core/src/main/java/org/apache/wicket/Page.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/Page.java b/wicket-core/src/main/java/org/apache/wicket/Page.java
index 240070e..c6da760 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Page.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Page.java
@@ -313,19 +313,21 @@ public abstract class Page extends MarkupContainer implements IRedirectListener,
}
final IPageManager pageManager = getSession().getPageManager();
- if (!getFlag(FLAG_IS_DIRTY) && isVersioned() && pageManager.supportsVersioning())
+ if (!getFlag(FLAG_IS_DIRTY) &&
+ (
+ isVersioned() && pageManager.supportsVersioning() ||
+
+ // we need to get pageId for new page instances even when the page doesn't need
+ // versioning, otherwise pages override each other in the page store and back button
+ // support is broken
+ isInitialization
+ )
+ )
{
setFlag(FLAG_IS_DIRTY, true);
setNextAvailableId();
pageManager.touchPage(this);
}
- else if (isInitialization)
- {
- // we need to get pageId for new page instances even when the page doesn't need
- // versioning, otherwise pages override each other in the page store and back button
- // support is broken
- setNextAvailableId();
- }
}
/**
http://git-wip-us.apache.org/repos/asf/wicket/blob/f7a7e557/wicket-core/src/main/java/org/apache/wicket/settings/IPageSettings.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/settings/IPageSettings.java b/wicket-core/src/main/java/org/apache/wicket/settings/IPageSettings.java
index 901f456..e3d8728 100644
--- a/wicket-core/src/main/java/org/apache/wicket/settings/IPageSettings.java
+++ b/wicket-core/src/main/java/org/apache/wicket/settings/IPageSettings.java
@@ -45,13 +45,22 @@ public interface IPageSettings
List<IComponentResolver> getComponentResolvers();
/**
- * @return Returns the pagesVersionedByDefault.
+ * @return whether all pages should should update their page id when their component hierarchy
+ * changes somehow
*/
boolean getVersionPagesByDefault();
/**
+ * A global setting that tells the pages to update their page id if their component
+ * hierarchy changes somehow. This way versioned pages can have several versions
+ * stored in the page stores and the user can go back and forth through the different
+ * versions. If a page is not versioned then only its last state is keep in the page
+ * stores and going back will lead the user to the page before the current one, not
+ * to the previous state of the current one.
+ *
* @param pagesVersionedByDefault
- * The pagesVersionedByDefault to set.
+ * a flag that indicates whether pages should increase their page id when
+ * their component hierarchy changes somehow.
*/
void setVersionPagesByDefault(boolean pagesVersionedByDefault);