Author: ivaynberg
Date: Fri Feb 5 06:24:35 2010
New Revision: 906822
URL: http://svn.apache.org/viewvc?rev=906822&view=rev
Log:
WICKET-2657 fix chrome ajax file upload
Issue: WICKET-2657
Modified:
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
Modified:
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
URL:
http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js?rev=906822&r1=906821&r2=906822&view=diff
==============================================================================
---
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
(original)
+++
wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
Fri Feb 5 06:24:35 2010
@@ -1124,8 +1124,6 @@
iframe.style.display="none";
iframe.style.visibility="hidden";
-
- Wicket.Event.add(iframe, "load",
this.handleMultipartComplete.bind(this));
document.body.appendChild(iframe);
@@ -1152,6 +1150,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;