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 2014/01/16 15:32:37 UTC

git commit: WICKET-4697 Autolinking not working as soon as component gets a wicket:id

Updated Branches:
  refs/heads/wicket-6.x 2c3aa01ab -> b1f247926


WICKET-4697 Autolinking not working as soon as component gets a wicket:id

(cherry picked from commit a595d838c41730da82cb7d3c698661add46fcd6a)


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

Branch: refs/heads/wicket-6.x
Commit: b1f247926d46f0d82f96e378b11d4aa2e5456c94
Parents: 2c3aa01
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu Jan 16 16:30:05 2014 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu Jan 16 16:30:47 2014 +0200

----------------------------------------------------------------------
 .../wicket/markup/html/image/ContextImage.java     | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/b1f24792/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ContextImage.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ContextImage.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ContextImage.java
index 39687e7..25d7759 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ContextImage.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/image/ContextImage.java
@@ -18,6 +18,7 @@ package org.apache.wicket.markup.html.image;
 
 import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.markup.html.WebComponent;
+import org.apache.wicket.markup.parser.filter.RelativePathPrefixHandler;
 import org.apache.wicket.model.IModel;
 
 /**
@@ -37,6 +38,7 @@ public class ContextImage extends WebComponent
 	 * Constructor
 	 * 
 	 * @param id
+	 *            the component id
 	 * @param contextRelativePath
 	 *            context-relative path eg <code>images/border.jpg</code>
 	 */
@@ -50,6 +52,7 @@ public class ContextImage extends WebComponent
 	 * Constructor
 	 * 
 	 * @param id
+	 *            the component id
 	 * @param contextRelativePath
 	 *            context-relative path eg <code>images/border.jpg</code>
 	 */
@@ -59,6 +62,20 @@ public class ContextImage extends WebComponent
 		add(new ContextPathGenerator(contextRelativePath));
 	}
 
+	/**
+	 * Constructor.
+	 *
+	 * Uses the url from the <em>src</em> markup attribute and makes
+	 * it relative to the context path
+	 *
+	 * @param id
+	 *           the component id
+	 */
+	public ContextImage(String id)
+	{
+		super(id);
+		add(RelativePathPrefixHandler.RELATIVE_PATH_BEHAVIOR);
+	}
 
 	/**
 	 * @see org.apache.wicket.Component#onComponentTag(ComponentTag)