WICKET-5306 Dynamic extra paramaters not evaluated in ajax submitting behavior in a multipart form
When doing Ajax multipart submit execute the beforeSend handlers and show the indicator just before making the form submit. This makes it consistent with the non-multipart processing. And additionally there was a chance to show the indicator and then fail to hide it because the form element may not be found Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/ad53a1bc Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/ad53a1bc Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/ad53a1bc Branch: refs/heads/5299-ajax-strategy Commit: ad53a1bc3054e6db75ffc484d2981874ad5eed90 Parents: 12f7781 Author: Martin Tzvetanov Grigorov <mgrigo...@apache.org> Authored: Wed Aug 7 10:56:30 2013 +0200 Committer: Martin Tzvetanov Grigorov <mgrigo...@apache.org> Committed: Wed Aug 7 10:56:30 2013 +0200 ---------------------------------------------------------------------- .../apache/wicket/ajax/res/js/wicket-ajax-jquery.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/ad53a1bc/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 0ffae61..b584861 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 @@ -755,14 +755,6 @@ var attrs = context.attrs; - this._executeHandlers(attrs.bsh, attrs, null, null); - Wicket.Event.publish('/ajax/call/beforeSend', attrs, null, null); - - if (attrs.i) { - // show the indicator - Wicket.DOM.showIncrementally(attrs.i); - } - var form = Wicket.$(attrs.f); if (!form) { Wicket.Log.error("Wicket.Ajax.Call.submitForm: Trying to submit form with id '" + attrs.f + "' that is not in document."); @@ -827,6 +819,14 @@ form.appendChild($btn[0]); } + this._executeHandlers(attrs.bsh, attrs, null, null); + Wicket.Event.publish('/ajax/call/beforeSend', attrs, null, null); + + if (attrs.i) { + // show the indicator + Wicket.DOM.showIncrementally(attrs.i); + } + //submit the form into the iframe, response will be handled by the onload callback form.submit();