You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by cm...@apache.org on 2012/08/16 16:32:39 UTC

git commit: AjaxFormSubmitBehavior should default to POST if no method is set, and it should check the root form for the multipart flag, not a nested form

Updated Branches:
  refs/heads/master 947fa7c56 -> a66d31ef6


AjaxFormSubmitBehavior should default to POST if no method is set, and it should check the root form for the multipart flag, not a nested form


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/a66d31ef
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/a66d31ef
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/a66d31ef

Branch: refs/heads/master
Commit: a66d31ef674793278c63cf5638152e6e2560f435
Parents: 947fa7c
Author: Carl-Eric Menzel <cm...@wicketbuch.de>
Authored: Thu Aug 16 16:31:33 2012 +0200
Committer: Carl-Eric Menzel <cm...@wicketbuch.de>
Committed: Thu Aug 16 16:31:33 2012 +0200

----------------------------------------------------------------------
 .../wicket/ajax/form/AjaxFormSubmitBehavior.java   |    4 ++--
 .../ajax/form/AjaxFormSubmitTestPage_expected.html |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/a66d31ef/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormSubmitBehavior.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormSubmitBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormSubmitBehavior.java
index 711b4a9..8df9885 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormSubmitBehavior.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormSubmitBehavior.java
@@ -129,12 +129,12 @@ public abstract class AjaxFormSubmitBehavior extends AjaxEventBehavior
 		attributes.setFormId(form.getMarkupId());
 
 		String formMethod = form.getMarkupAttributes().getString("method");
-		if ("POST".equalsIgnoreCase(formMethod))
+		if (formMethod == null || "POST".equalsIgnoreCase(formMethod))
 		{
 			attributes.setMethod(Method.POST);
 		}
 
-		if (form.isMultiPart())
+		if (form.getRootForm().isMultiPart())
 		{
 			attributes.setMultipart(true);
 			attributes.setMethod(Method.POST);

http://git-wip-us.apache.org/repos/asf/wicket/blob/a66d31ef/wicket-core/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTestPage_expected.html
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTestPage_expected.html b/wicket-core/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTestPage_expected.html
index 7bd11cd..4d71ee1 100644
--- a/wicket-core/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTestPage_expected.html
+++ b/wicket-core/src/test/java/org/apache/wicket/ajax/form/AjaxFormSubmitTestPage_expected.html
@@ -16,7 +16,7 @@ Wicket.Ajax.baseUrl="wicket/bookmarkable/org.apache.wicket.ajax.form.AjaxFormSub
 <script type="text/javascript" >
 /*<![CDATA[*/
 Wicket.Event.add(window, "domready", function(event) { 
-Wicket.Ajax.ajax({"f":"form1","u":"../page?0-1.IBehaviorListener.0-form-submit","e":"click","c":"submit2","sc":":submit"});;
+Wicket.Ajax.ajax({"f":"form1","u":"../page?0-1.IBehaviorListener.0-form-submit","e":"click","c":"submit2","sc":":submit","m":"POST"});;
 ;});
 /*]]>*/
 </script>