Author: ivaynberg
Date: Fri Feb 5 06:25:11 2010
New Revision: 906823
URL: http://svn.apache.org/viewvc?rev=906823&view=rev
Log:
WICKET-2657 fix chrome ajax file upload
Issue: WICKET-2657
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=906823&r1=906822&r2=906823&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 Fri
Feb 5 06:25:11 2010
@@ -1126,8 +1126,6 @@
iframe.style.display="none";
iframe.style.visibility="hidden";
-
- Wicket.Event.add(iframe, "load",
this.handleMultipartComplete.bind(this));
document.body.appendChild(iframe);
@@ -1154,6 +1152,11 @@
//submit the form into the iframe, response will be handled by
the onload callback
form.submit();
+
+ // install handler to deal with the ajax response
+ // ... we add the onload event after form submit because chrome
fires it prematurely
+ Wicket.Event.add(iframe, "load",
this.handleMultipartComplete.bind(this));
+
// handled, restore state and return true
form.action=originalFormAction;
form.target=originalFormTarget;