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 2008/01/28 19:53:32 UTC

svn commit: r615995 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/resources/org/apache/tapestry/tapestry.js test/app1/DisabledFields.tml test/java/org/apache/tapestry/integration/app1/pages/DisabledFields.java

Author: hlship
Date: Mon Jan 28 10:53:31 2008
New Revision: 615995

URL: http://svn.apache.org/viewvc?rev=615995&view=rev
Log:
TAPESTRY-2052: Disabled fields still perfom client side validation

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DisabledFields.tml
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/DisabledFields.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js?rev=615995&r1=615994&r2=615995&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/tapestry.js Mon Jan 28 10:53:31 2008
@@ -481,6 +481,8 @@
 
     validateInput : function(event)
     {
+        if (this.field.disabled) return;
+        
         // Clear out old decorations.  It's easier to remove the decorations
         // and then re-add them if the field is in error than it is to
         // toggle them on or off at the end.
@@ -497,7 +499,6 @@
 
         this.validators.each(function(tuple)
         {
-
             var acceptBlank = tuple[0];
             var validator = tuple[1];
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DisabledFields.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DisabledFields.tml?rev=615995&r1=615994&r2=615995&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DisabledFields.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DisabledFields.tml Mon Jan 28 10:53:31 2008
@@ -37,6 +37,7 @@
 
         <br/>
 
-        <t:submit t:id="submit" disabled="true"/>
+        <t:submit t:id="submit" disabled="true" value="Disabled Submit"/>
+        <input type="submit" value="Continue"/>
     </t:form>
 </html>

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/DisabledFields.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/DisabledFields.java?rev=615995&r1=615994&r2=615995&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/DisabledFields.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/DisabledFields.java Mon Jan 28 10:53:31 2008
@@ -15,6 +15,7 @@
 package org.apache.tapestry.integration.app1.pages;
 
 import org.apache.tapestry.ValueEncoder;
+import org.apache.tapestry.beaneditor.Validate;
 import org.apache.tapestry.internal.services.StringValueEncoder;
 
 import java.util.Date;
@@ -30,6 +31,7 @@
 
     private List<String> _values;
 
+    @Validate("required")
     public String getStringValue()
     {
         return _stringValue;