cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: rev 53781 - cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel
Date Tue, 05 Oct 2004 07:48:55 GMT
Author: sylvain
Date: Tue Oct  5 00:48:54 2004
New Revision: 53781

Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java
Log:
Allow setting a null value to an Upload widget

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java
Tue Oct  5 00:48:54 2004
@@ -59,10 +59,10 @@
     }
 
     public void setValue(Object object) {
-        if (!(object instanceof Part)) {
-            throw new RuntimeException("The value of an upload widget must be of type " +
Part.class + ".");
+        if ((object == null) || (object instanceof Part)) {
+            this.part = (Part)object;
         }
-        this.part = (Part)object;
+        throw new RuntimeException("The value of an upload widget must be of type " + Part.class
+ ".");
     }
 
     public void readFromRequest(FormContext formContext) {

Mime
View raw message