cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: r349516 - in /cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel: Action.java Form.java
Date Mon, 28 Nov 2005 21:53:13 GMT
Author: sylvain
Date: Mon Nov 28 13:53:01 2005
New Revision: 349516

URL: http://svn.apache.org/viewcvs?rev=349516&view=rev
Log:
Fixing the previous fix, that actually broke actions...

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

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Action.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Action.java?rev=349516&r1=349515&r2=349516&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Action.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Action.java Mon Nov 28
13:53:01 2005
@@ -57,9 +57,9 @@
         String fullId = getRequestParameterName();
         Request request = formContext.getRequest();
 
-        String value = request.getParameter(fullId);
-        if (value != null) {
-            form.setSubmitWidget(this);
+        if (request.getParameter(fullId) != null ||
+                fullId.equals(request.getParameter(Form.SUBMIT_ID_PARAMETER))) {
+           form.setSubmitWidget(this);
 
         } else {
             // Special workaround an IE bug for <input type="image" name="foo"> :
@@ -68,7 +68,7 @@
             //
             // Note that since actions are terminal widgets, there's no chance of conflict
             // with a child "x" or "y" widget.
-            value = request.getParameter(fullId + ".x");
+            String value = request.getParameter(fullId + ".x");
             if ((value != null) && value.length() > 0) {
                 form.setSubmitWidget(this);
             }

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=349516&r1=349515&r2=349516&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 Mon Nov 28
13:53:01 2005
@@ -42,6 +42,9 @@
  */
 public class Form extends AbstractContainerWidget
                   implements ValidationErrorAware {
+    
+    /** Form parameter containing the submit widget's id */
+    public static final String SUBMIT_ID_PARAMETER = "forms_submit_id";
 
     private static final String FORM_EL = "form";
 
@@ -316,7 +319,7 @@
         // 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");
+        String submitId = formContext.getRequest().getParameter(SUBMIT_ID_PARAMETER);
         if (submitId != null && submitId.length() > 0) {
             // if the form has an ID, it is used as part of the submitId too
             // this has ID has to be cut off



Mime
View raw message