want to try QUnit ? :-) On Mar 26, 2013 11:22 PM, <[email protected]> wrote:
> Updated Branches: > refs/heads/master 15e5b0ec5 -> ea29f1f7c > > > fix WICKET-5117 Wicket ignores allowDefault:false attribute in multipart > ajax requests > > > Project: http://git-wip-us.apache.org/repos/asf/wicket/repo > Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/ea29f1f7 > Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/ea29f1f7 > Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/ea29f1f7 > > Branch: refs/heads/master > Commit: ea29f1f7c04fdec88a06d056b1ddf4f9d345a22d > Parents: 15e5b0e > Author: Igor Vaynberg <[email protected]> > Authored: Tue Mar 26 14:22:31 2013 -0700 > Committer: Igor Vaynberg <[email protected]> > Committed: Tue Mar 26 14:22:31 2013 -0700 > > ---------------------------------------------------------------------- > .../wicket/ajax/res/js/wicket-ajax-jquery.js | 17 ++++++++++++-- > 1 files changed, 14 insertions(+), 3 deletions(-) > ---------------------------------------------------------------------- > > > > http://git-wip-us.apache.org/repos/asf/wicket/blob/ea29f1f7/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 11ab136..1f80ded 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 > @@ -528,7 +528,9 @@ > Wicket.Event.publish('/ajax/call/precondition', > attrs); > > if (attrs.mp) { // multipart form. jQuery.ajax() > doesn't help here ... > - return this.submitMultipartForm(context); > + var ret = > this.submitMultipartForm(context); > + self.preventDefaultIfNecessary(attrs); > + return ret; > } > > if (attrs.f) { > @@ -635,6 +637,17 @@ > self._executeHandlers(attrs.ah, attrs); > Wicket.Event.publish('/ajax/call/after', attrs); > > + self.preventDefaultIfNecessary(attrs); > + > + return jqXHR; > + }, > + > + /** > + * Aborts the default event if attributes request it > + * > + * @param {Object} attrs - the Ajax request attributes > configured at the server side > + */ > + preventDefaultIfNecessary: function(attrs) { > if (!attrs.ad && attrs.event) { > try { > attrs.event.preventDefault(); > @@ -643,8 +656,6 @@ > // jquery fails 'member not found' > with calls on busy channel > } > } > - > - return jqXHR; > }, > > /** > >
