You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2014/01/06 19:25:25 UTC

git commit: AAU-5462 fix npe in ajax form component label repainting

Updated Branches:
  refs/heads/wicket-6.x 44fd2e941 -> 512a573e1


AAU-5462 fix npe in ajax form component label repainting


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

Branch: refs/heads/wicket-6.x
Commit: 512a573e15753e905e1aafbf9b451d0460e6ba2f
Parents: 44fd2e9
Author: Igor Vaynberg <ig...@gmail.com>
Authored: Mon Jan 6 10:25:19 2014 -0800
Committer: Igor Vaynberg <ig...@gmail.com>
Committed: Mon Jan 6 10:25:19 2014 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/wicket/markup/html/form/Form.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/512a573e/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 a9ea6a6..918edec 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
@@ -778,10 +778,10 @@ public class Form<T> extends WebMarkupContainer implements IFormSubmitListener,
 			callOnError(submitter);
 		}
 
-
-		if (((WebRequest)getRequest()).isAjax())
+		// update auto labels if we are inside an ajax request
+		final AjaxRequestTarget target = getRequestCycle().find(AjaxRequestTarget.class);
+		if (target != null)
 		{
-			final AjaxRequestTarget target = getRequestCycle().find(AjaxRequestTarget.class);
 			visitChildren(FormComponent.class, new IVisitor<FormComponent<?>, Void>()
 			{
 				@Override