You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by si...@apache.org on 2009/12/15 17:09:49 UTC

svn commit: r890854 - /labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/htmlpieces/AbstractSelectionHtmlFormPiece.java

Author: simoneg
Date: Tue Dec 15 16:09:48 2009
New Revision: 890854

URL: http://svn.apache.org/viewvc?rev=890854&view=rev
Log:
Offer null selection when validation is not mandatory

Modified:
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/htmlpieces/AbstractSelectionHtmlFormPiece.java

Modified: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/htmlpieces/AbstractSelectionHtmlFormPiece.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/htmlpieces/AbstractSelectionHtmlFormPiece.java?rev=890854&r1=890853&r2=890854&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/htmlpieces/AbstractSelectionHtmlFormPiece.java (original)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/htmlpieces/AbstractSelectionHtmlFormPiece.java Tue Dec 15 16:09:48 2009
@@ -63,7 +63,11 @@
 			String acval = property == null ? conv.to(value) : property.toString(value);
 			if (property != null) {
 				CompoundValidator<Object> val = property.getValidator();
-				if (val == null || (val.acceptsNulls() && !elements.contains(null))) {
+				boolean needsNull = val == null || (val.acceptsNulls() && !elements.contains(null));
+				if (!needsNull && getForm() != null) {
+					needsNull = getForm().isDontValidate(); 
+				}
+				if (needsNull) {
 					createDropDownOption(out, null, property.toString(null), acval);			
 				}			
 			}



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org