You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2009/04/20 17:33:19 UTC
svn commit: r766730 - in
/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5:
FieldFocusPriority.java RenderSupport.java corelib/base/AbstractField.java
Author: hlship
Date: Mon Apr 20 15:33:17 2009
New Revision: 766730
URL: http://svn.apache.org/viewvc?rev=766730&view=rev
Log:
TAP5-657: The FieldFocusPriority enum should include an additional value, MANUAL, to indicate a manually focused field (with highest priority)
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/FieldFocusPriority.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/RenderSupport.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/FieldFocusPriority.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/FieldFocusPriority.java?rev=766730&r1=766729&r2=766730&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/FieldFocusPriority.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/FieldFocusPriority.java Mon Apr 20 15:33:17 2009
@@ -16,6 +16,8 @@
/**
* Used to determine which field on a page should receive focus, based on its status.
+ *
+ * @see org.apache.tapestry5.RenderSupport#autofocus(FieldFocusPriority, String)
*/
public enum FieldFocusPriority
{
@@ -32,5 +34,13 @@
/**
* A field that contains a validation error, the highest priority.
*/
- IN_ERROR
+ IN_ERROR,
+
+ /**
+ * Used to allow field focus to be manually overridden; this would be selected in user code and is higher priorty
+ * than {@link #IN_ERROR}.
+ *
+ * @since 5.1.0.4
+ */
+ OVERRIDE;
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/RenderSupport.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/RenderSupport.java?rev=766730&r1=766729&r2=766730&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/RenderSupport.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/RenderSupport.java Mon Apr 20 15:33:17 2009
@@ -138,7 +138,8 @@
/**
* Invoked to set focus on a rendered field. Takes into account priority, meaning that a field with errors will take
- * precendence over a merely required field, and over a field that is optional.
+ * precendence over a merely required field, and over a field that is optional. The value {@link
+ * org.apache.tapestry5.FieldFocusPriority#OVERRIDE} can be used to force a particular field to receive focus.
*
* @param priority focus is set only if the provided priority is greater than the current priority
* @param fieldId id of client-side element to take focus
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java?rev=766730&r1=766729&r2=766730&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractField.java Mon Apr 20 15:33:17 2009
@@ -16,10 +16,10 @@
import org.apache.tapestry5.*;
import org.apache.tapestry5.annotations.*;
+import org.apache.tapestry5.corelib.internal.InternalMessages;
import org.apache.tapestry5.corelib.mixins.DiscardBody;
import org.apache.tapestry5.corelib.mixins.RenderDisabled;
import org.apache.tapestry5.corelib.mixins.RenderInformals;
-import org.apache.tapestry5.corelib.internal.InternalMessages;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.ComponentDefaultProvider;
import org.apache.tapestry5.services.FormSupport;