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/04/16 02:46:28 UTC

svn commit: r648475 - /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java

Author: hlship
Date: Tue Apr 15 17:46:26 2008
New Revision: 648475

URL: http://svn.apache.org/viewvc?rev=648475&view=rev
Log:
TAPESTRY-2276: Required validation fails when used with select and blankOption="ALWAYS"

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java?rev=648475&r1=648474&r2=648475&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java Tue Apr 15 17:46:26 2008
@@ -26,6 +26,7 @@
 import org.apache.tapestry.internal.util.SelectModelRenderer;
 import org.apache.tapestry.ioc.Messages;
 import org.apache.tapestry.ioc.annotations.Inject;
+import org.apache.tapestry.ioc.internal.util.InternalUtils;
 import org.apache.tapestry.services.*;
 import org.apache.tapestry.util.EnumSelectModel;
 
@@ -143,7 +144,9 @@
 
         _tracker.recordInput(this, submittedValue);
 
-        Object selectedValue = _encoder.toValue(submittedValue);
+        Object selectedValue = InternalUtils.isBlank(submittedValue)
+                               ? null :
+                               _encoder.toValue(submittedValue);
 
         try
         {