ImageSubmit should check parameter name + X since IE doesn't send the name
git-svn-id: https://svn.apache.org/repos/asf/click/trunk/click@1060162 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/org/apache/click/control/ImageSubmit.java b/framework/src/org/apache/click/control/ImageSubmit.java
index 803f90a..c0d3497 100644
--- a/framework/src/org/apache/click/control/ImageSubmit.java
+++ b/framework/src/org/apache/click/control/ImageSubmit.java
@@ -186,7 +186,7 @@
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 @@
}
/**
+ * 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()