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 2013/05/16 09:05:51 UTC

git commit: Revert "WICKET-5179 Move Form hidden field rendering to dedicated method"

Updated Branches:
  refs/heads/wicket-6.x 3df529329 -> 96a5772c1


Revert "WICKET-5179 Move Form hidden field rendering to dedicated method"

This reverts commit d0e2335536b8d5fdd08eb50d9f9258fbd9ee8581.


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

Branch: refs/heads/wicket-6.x
Commit: 96a5772c1f2d51e2bb5af2c483c5b432abe70003
Parents: 3df5293
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu May 16 10:05:29 2013 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu May 16 10:05:29 2013 +0300

----------------------------------------------------------------------
 .../org/apache/wicket/markup/html/form/Form.java   |   58 ++++++---------
 1 files changed, 24 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/96a5772c/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
index eb5f6c0..a7f07f3 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java
@@ -1642,7 +1642,30 @@ public class Form<T> extends WebMarkupContainer
 	{
 		if (isRootForm())
 		{
-			writeHiddenField(getResponse());
+			// get the hidden field id
+			String nameAndId = getHiddenFieldId();
+
+			// render the hidden field
+			AppendingStringBuffer buffer = new AppendingStringBuffer(HIDDEN_DIV_START).append(
+				"<input type=\"hidden\" name=\"")
+				.append(nameAndId)
+				.append("\" id=\"")
+				.append(nameAndId)
+				.append("\" />");
+
+			// if it's a get, did put the parameters in the action attribute,
+			// and have to write the url parameters as hidden fields
+			if (encodeUrlInHiddenFields())
+			{
+				String url = getActionUrl().toString();
+				int i = url.indexOf('?');
+				String queryString = (i > -1) ? url.substring(i + 1) : url;
+				String[] params = Strings.split(queryString, '&');
+
+				writeParamsAsHiddenFields(params, buffer);
+			}
+			buffer.append("</div>");
+			getResponse().write(buffer);
 
 			// if a default submitting component was set, handle the rendering of that
 			if (defaultSubmittingComponent instanceof Component)
@@ -1661,39 +1684,6 @@ public class Form<T> extends WebMarkupContainer
 	}
 
 	/**
-	 * Writes the markup for the hidden input field into the provided response
-	 *
-	 * @param response
-	 *      The response to write to
-	 */
-	public final void writeHiddenField(final Response response)
-	{
-		// get the hidden field id
-		String nameAndId = getHiddenFieldId();
-
-		AppendingStringBuffer buffer = new AppendingStringBuffer(HIDDEN_DIV_START).append(
-				"<input type=\"hidden\" name=\"")
-				.append(nameAndId)
-				.append("\" id=\"")
-				.append(nameAndId)
-				.append("\" />");
-
-		// if it's a get, did put the parameters in the action attribute,
-		// and have to write the url parameters as hidden fields
-		if (encodeUrlInHiddenFields())
-		{
-			String url = getActionUrl().toString();
-			int i = url.indexOf('?');
-			String queryString = (i > -1) ? url.substring(i + 1) : url;
-			String[] params = Strings.split(queryString, '&');
-
-			writeParamsAsHiddenFields(params, buffer);
-		}
-		buffer.append("</div>");
-		response.write(buffer);
-	}
-
-	/**
 	 * 
 	 * @param params
 	 * @param buffer