You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ti...@apache.org on 2004/11/09 20:28:04 UTC

svn commit: rev 57073 - cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel

Author: tim
Date: Tue Nov  9 11:28:03 2004
New Revision: 57073

Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Field.java
Log:
Cforms Field: Make sure old value has been parsed and validated.

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Field.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Field.java	(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Field.java	Tue Nov  9 11:28:03 2004
@@ -201,17 +201,18 @@
         // Only convert if the text value actually changed. Otherwise, keep the old value
         // and/or the old validation error (allows to keep errors when clicking on actions)
         if (!(newEnteredValue == null ? "" : newEnteredValue).equals((enteredValue == null ? "" : enteredValue))) {
+            // Make sure the old value has been parsed and validated.
+            Object oldValue = getValue();
             enteredValue = newEnteredValue;
             validationError = null;
-            Object oldValue = value;
             value = null;
             this.valueState = VALUE_UNPARSED;
 
             if (hasValueChangedListeners()) {
-                // Throw an event that will parse the value only if needed.
-                // This event holds the old value and will lazily compute the new one if needed
+                // Throw an event that will hold the old value and
+                // will lazily compute the new value only if needed.
                 getForm().addWidgetEvent(new DeferredValueChangedEvent(this, oldValue));
-    	        }
+            }
         }
     }