You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2005/08/30 00:48:25 UTC
svn commit: r264649 - in /jakarta/tapestry/trunk:
examples/Workbench/src/context/Fields.html
framework/src/java/org/apache/tapestry/valid/ValidationDelegate.java
framework/src/test/org/apache/tapestry/valid/TestValidationDelegate.java
status.xml
Author: hlship
Date: Mon Aug 29 15:48:19 2005
New Revision: 264649
URL: http://svn.apache.org/viewcvs?rev=264649&view=rev
Log:
TAPESTRY-609: Tapestry.set_focus() seems to be passed the form components elementId (i.e. name attribute) not clientId (i.e. id attribute), which keeps focus from being set
Modified:
jakarta/tapestry/trunk/examples/Workbench/src/context/Fields.html
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidationDelegate.java
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/valid/TestValidationDelegate.java
jakarta/tapestry/trunk/status.xml
Modified: jakarta/tapestry/trunk/examples/Workbench/src/context/Fields.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Workbench/src/context/Fields.html?rev=264649&r1=264648&r2=264649&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Workbench/src/context/Fields.html (original)
+++ jakarta/tapestry/trunk/examples/Workbench/src/context/Fields.html Mon Aug 29 15:48:19 2005
@@ -53,7 +53,7 @@
<tr>
<th><label jwcid="@FieldLabel" accessKey="z" field="component:zipCode"/></th>
- <td><input jwcid="zipCode"/></td>
+ <td><input jwcid="zipCode" id="zipcode"/></td>
</tr>
<tr>
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidationDelegate.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidationDelegate.java?rev=264649&r1=264648&r2=264649&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidationDelegate.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/valid/ValidationDelegate.java Mon Aug 29 15:48:19 2005
@@ -437,7 +437,7 @@
{
if (priority > _focusPriority)
{
- _focusField = field.getName();
+ _focusField = field.getClientId();
_focusPriority = priority;
}
}
Modified: jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/valid/TestValidationDelegate.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/valid/TestValidationDelegate.java?rev=264649&r1=264648&r2=264649&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/valid/TestValidationDelegate.java (original)
+++ jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/valid/TestValidationDelegate.java Mon Aug 29 15:48:19 2005
@@ -341,4 +341,34 @@
verifyControls();
}
-}
\ No newline at end of file
+
+ public void testRegistryForFocus()
+ {
+ IFormComponent fred = newFieldWithClientId("fred");
+ IFormComponent barney = newFieldWithClientId("barney");
+ IFormComponent wilma = newField();
+
+ ValidationDelegate vd = new ValidationDelegate();
+
+ replayControls();
+
+ vd.registerForFocus(fred, ValidationConstants.NORMAL_FIELD);
+ vd.registerForFocus(barney, ValidationConstants.REQUIRED_FIELD);
+ vd.registerForFocus(wilma, ValidationConstants.NORMAL_FIELD);
+
+ assertEquals("barney", vd.getFocusField());
+
+ verifyControls();
+ }
+
+ private IFormComponent newFieldWithClientId(String clientId)
+ {
+ MockControl control = newControl(IFormComponent.class);
+ IFormComponent field = (IFormComponent) control.getMock();
+
+ field.getClientId();
+ control.setReturnValue(clientId);
+
+ return field;
+ }
+}
Modified: jakarta/tapestry/trunk/status.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/status.xml?rev=264649&r1=264648&r2=264649&view=diff
==============================================================================
--- jakarta/tapestry/trunk/status.xml (original)
+++ jakarta/tapestry/trunk/status.xml Mon Aug 29 15:48:19 2005
@@ -54,6 +54,7 @@
<action type="update" dev="HLS" due-to="Henri Yandell">Convert Tapestry repository from CVS to SVN</action>
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-611">Pattern validator invokes wrong client-side JavaScript function</action>
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-610">$bean syntax for validators: binding prefix is broken</action>
+ <action type="fix" dev="HLS" fixes-bug="TAPESTRY-609">Tapestry.set_focus() seems to be passed the form components elementId (i.e. name attribute) not clientId (i.e. id attribute), which keeps focus from being set</action>
</release>
<release version="4.0-beta-5" date="Aug 26 2005">
<action type="fix" dev="MB,HLS" fixes-bug="TAPESTRY-552">Improperly configured SerializableAdaptor (for DataSqueezer) prevents serialized objects from being de-serialized</action>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org