Author: ivaynberg
Date: Wed Sep 16 05:52:31 2009
New Revision: 815617
URL: http://svn.apache.org/viewvc?rev=815617&view=rev
Log:
WICKET-2433 support multipart ajax in embedded forms
Issue: WICKET-2433
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=815617&r1=815616&r2=815617&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
Wed Sep 16 05:52:31 2009
@@ -1074,6 +1074,18 @@
// and bridge the output - transparently making this work as if it was
an ajax call
handleMultipart: function (form, submitButton) {
+ // find root form
+ if (form.tagName.toLowerCase() != "form") {
+ do {
+ form = form.parentNode;
+ } while(form.tagName.toLowerCase() != "form" &&
form.tagName.toLowerCase() != "body")
+ }
+
+ if (form.tagName.toLowerCase() != "form") {
+ // no form in the hierarchy, cant handle multipart
+ return false;
+ }
+
if (form.enctype!="multipart/form-data") {
// not handled, return false
return false;