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 2010/09/11 17:35:14 UTC

svn commit: r996158 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js

Author: mgrigorov
Date: Sat Sep 11 15:35:14 2010
New Revision: 996158

URL: http://svn.apache.org/viewvc?rev=996158&view=rev
Log:
WICKET-3040 Ajax form submit fails in Wicket 1.4.11/Firefox3.6

Do not fire form.submit() because this makes normal (non-ajax) call and calls just Form.onSubmit().
Just call form.onsubmit() if there is such and do not do anything if it returns negative result

merge r996157 from wicket 1.4.x


Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js?rev=996158&r1=996157&r2=996158&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js Sat Sep 11 15:35:14 2010
@@ -1069,7 +1069,9 @@ Wicket.Ajax.Call.prototype = {
 	// Submits a form using ajax.
 	// This method serializes a form and sends it as POST body.
 	submitForm: function(form, submitButton) {
-	    if (!Wicket.Event.fire(form, "submit")) return;
+		if (form.onsubmit) {	
+			if (!form.onsubmit()) return;
+		}
 	    
 	    if (this.handleMultipart(form, submitButton)) {
 	    	return true;