You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2013/11/20 13:45:49 UTC

[2/4] git commit: WICKET-5420 Make UploadProgressBar easier to extend

WICKET-5420 Make UploadProgressBar easier to extend

Always remove the custom attribute Wicket sets to form element when calling its onsubmit() method.
onsubmit() may throw an exception and the attribute won't be removed.


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/05939320
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/05939320
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/05939320

Branch: refs/heads/wicket-6.x
Commit: 05939320c54949e20372c940622c528024addb71
Parents: 9eb670b
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Wed Nov 20 14:20:48 2013 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Wed Nov 20 14:28:52 2013 +0200

----------------------------------------------------------------------
 .../org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js     | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/05939320/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index 6144ceb..190e1e7 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -779,11 +779,12 @@
 
 			if (form.onsubmit && !form.getAttribute(submittingAttribute)) {
 				form.setAttribute(submittingAttribute, submittingAttribute);
-				var retValue = form.onsubmit();
-				if (typeof(retValue) === "undefined") {
-					retValue = true;
+				var retValue = true;
+				try {
+					retValue = form.onsubmit();
+				} finally {
+					form.removeAttribute(submittingAttribute);
 				}
-				form.removeAttribute(submittingAttribute);
 				if (!retValue) {
 					return;
 				}