Author: hlship
Date: Mon Apr 14 13:00:17 2008
New Revision: 647977
URL: http://svn.apache.org/viewvc?rev=647977&view=rev
Log:
TAPESTRY-2345: Use "flash" persistence on Form's ValidationTracker
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryConstants.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
tapestry/tapestry5/trunk/tapestry-core/src/site/apt/upgrade.apt
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryConstants.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryConstants.java?rev=647977&r1=647976&r2=647977&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryConstants.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/TapestryConstants.java
Mon Apr 14 13:00:17 2008
@@ -121,7 +121,8 @@
*/
public static final String FILE_CHECK_UPDATE_TIMEOUT_SYMBOL =
"tapestry.file-check-update-timeout";
- private TapestryConstants()
- {
- }
+ /**
+ * The page field persistence strategy that stores data in the session
until the next request.
+ */
+ public static final String FLASH_PERSISTENCE_STRATEGY = "flash";
}
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java?rev=647977&r1=647976&r2=647977&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Form.java
Mon Apr 14 13:00:17 2008
@@ -151,7 +151,7 @@
@Inject
private ComponentSource _source;
- @Persist
+ @Persist(TapestryConstants.FLASH_PERSISTENCE_STRATEGY)
private ValidationTracker _defaultTracker;
@Inject
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java?rev=647977&r1=647976&r2=647977&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
Mon Apr 14 13:00:17 2008
@@ -1558,7 +1558,7 @@
PersistentFieldStrategy
clientStrategy)
{
configuration.add("session", new
SessionPersistentFieldStrategy(request));
- configuration.add("flash", new FlashPersistentFieldStrategy(request));
+ configuration.add(TapestryConstants.FLASH_PERSISTENCE_STRATEGY, new
FlashPersistentFieldStrategy(request));
configuration.add("client", clientStrategy);
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/site/apt/upgrade.apt
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/site/apt/upgrade.apt?rev=647977&r1=647976&r2=647977&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/site/apt/upgrade.apt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/site/apt/upgrade.apt Mon Apr 14
13:00:17 2008
@@ -14,6 +14,15 @@
Release 5.0.12
+* Form component
+
+ The default
{{{../apidocs/org/apache/tapestry/ValidationTracker.html}ValidationTracker}}
+ built into the Form component now has a persistence strategy of "flash".
This means that
+ if you navigate away from a page with validation errors and return, you will
lose the errors
+ To support this style of navigation, you will need to bind the Form's
tracker parameter
+ to a field that has the correct persistency (most likely, "session", the
previous persistence
+ strategy).
+
* Resource.openStream()
The methods <<<exists()>>> and <<<openStream()>>> were added to the