click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1060162 - /click/trunk/click/framework/src/org/apache/click/control/ImageSubmit.java
Date Tue, 18 Jan 2011 02:08:14 GMT
Author: sabob
Date: Tue Jan 18 02:08:13 2011
New Revision: 1060162

URL: http://svn.apache.org/viewvc?rev=1060162&view=rev
Log:
ImageSubmit should check parameter name + X since IE doesn't send the name

Modified:
    click/trunk/click/framework/src/org/apache/click/control/ImageSubmit.java

Modified: click/trunk/click/framework/src/org/apache/click/control/ImageSubmit.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/control/ImageSubmit.java?rev=1060162&r1=1060161&r2=1060162&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/control/ImageSubmit.java (original)
+++ click/trunk/click/framework/src/org/apache/click/control/ImageSubmit.java Tue Jan 18 02:08:13
2011
@@ -186,7 +186,7 @@ public class ImageSubmit extends Submit 
 
         Context context = getContext();
 
-        //  Note IE does not submit name
+        // Note IE does not submit name
         String xValue = context.getRequestParameter(getName() + ".x");
 
         if (xValue != null) {
@@ -208,6 +208,38 @@ public class ImageSubmit extends Submit 
     }
 
     /**
+     * Process the submit event and return true to continue event processing.
+     *
+     * @see org.apache.click.control.Submit#onProcess()
+     *
+     * @return true to continue Page event processing or false otherwise
+     */
+    @Override
+    public boolean onProcess() {
+        if (isDisabled()) {
+            Context context = getContext();
+
+            // Switch off disabled property if control has incoming request
+            // parameter. Normally this means the field was enabled via JS
+            // Note IE does not submit name, so we check the X value
+            if (context.hasRequestParameter(getName() + ".x")) {
+                setDisabled(false);
+            } else {
+                // If field is disabled skip process event
+                return true;
+            }
+        }
+
+        bindRequestValue();
+
+        if (isClicked()) {
+            dispatchActionEvent();
+        }
+
+        return true;
+    }
+
+    /**
      * Render the HTML representation of the ImageButton.
      *
      * @see #toString()



Mime
View raw message