cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: r349231 - /cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Form.java
Date Sun, 27 Nov 2005 13:39:47 GMT
Author: sylvain
Date: Sun Nov 27 05:39:42 2005
New Revision: 349231

URL: http://svn.apache.org/viewcvs?rev=349231&view=rev
Log:
Fix bug when the submit widget is created when reading the request (e.g. row actions)

Modified:
    cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Form.java

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Form.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Form.java?rev=349231&r1=349230&r2=349231&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Form.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Form.java Sun Nov 27
05:39:42 2005
@@ -297,7 +297,24 @@
         }
 
         this.phase = ProcessingPhase.READ_FROM_REQUEST;
+
+        try {
+            // Start buffering events
+            this.bufferEvents = true;
+
+            doReadFromRequest(formContext);
+
+            // Fire events, still buffering them: this ensures they will be handled in the
same
+            // order as they were added.
+            fireEvents();
+        } finally {
+            // No need for buffering in the following phases
+            this.bufferEvents = false;
+        }
+
         // Find the submit widget, if not an action
+        // This has to occur after reading from the request, to handle stateless forms
+        // where the submit widget is recreated when the request is read (e.g. a row-action).
         this.submitWidget = null;
         String submitId = formContext.getRequest().getParameter("forms_submit_id");
         if (submitId != null && submitId.length() > 0) {
@@ -316,20 +333,6 @@
             }
 
             setSubmitWidget(submit);
-        }
-
-        try {
-            // Start buffering events
-            this.bufferEvents = true;
-
-            doReadFromRequest(formContext);
-
-            // Fire events, still buffering them: this ensures they will be handled in the
same
-            // order as they were added.
-            fireEvents();
-        } finally {
-            // No need for buffering in the following phases
-            this.bufferEvents = false;
         }
 
         // Notify the end of the current phase



Mime
View raw message