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 2007/04/28 03:09:18 UTC

svn commit: r533274 - in /incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup: Markup.java html/panel/Fragment.java

Author: ivaynberg
Date: Fri Apr 27 18:09:17 2007
New Revision: 533274

URL: http://svn.apache.org/viewvc?view=rev&rev=533274
Log:
WICKET-404 and better exception message in Fragment

Modified:
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/Markup.java
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/panel/Fragment.java

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/Markup.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/Markup.java?view=diff&rev=533274&r1=533273&r2=533274
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/Markup.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/Markup.java Fri Apr 27 18:09:17 2007
@@ -157,8 +157,8 @@
 
 	/**
 	 * For Wicket it would be sufficient for this method to be package
-	 * protected. However to allow wicket-bench easy access to the
-	 * information ...
+	 * protected. However to allow wicket-bench easy access to the information
+	 * ...
 	 * 
 	 * @param index
 	 *            Index into markup list
@@ -181,8 +181,8 @@
 
 	/**
 	 * For Wicket it would be sufficient for this method to be package
-	 * protected. However to allow wicket-bench easy access to the
-	 * information ...
+	 * protected. However to allow wicket-bench easy access to the information
+	 * ...
 	 * 
 	 * @return Number of markup elements
 	 */
@@ -362,8 +362,16 @@
 				this.componentMap = new HashMap();
 			}
 
+			/*
+			 * XXX cleanup - this fragment check probably needs to be in
+			 * componenttag.isWantToBeDirectMarkupChild() or something similar
+			 * instead of being here
+			 */
+			final boolean fragment = (tag instanceof WicketTag && ((WicketTag)tag).isFragementTag());
+
 			final String key;
-			if (tag.getPath() != null)
+
+			if (tag.getPath() != null && !fragment/* WICKET-404 */)
 			{
 				key = tag.getPath() + ":" + tag.getId();
 			}
@@ -455,8 +463,8 @@
 	}
 
 	/**
-	 * Reset the markup to its defaults, except for the wicket
-	 * namespace which remains unchanged.
+	 * Reset the markup to its defaults, except for the wicket namespace which
+	 * remains unchanged.
 	 */
 	final void reset()
 	{

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/panel/Fragment.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/panel/Fragment.java?view=diff&rev=533274&r1=533273&r2=533274
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/panel/Fragment.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/panel/Fragment.java Fri Apr 27 18:09:17 2007
@@ -236,8 +236,10 @@
 		int index = providerMarkupStream.findComponentIndex(null, markupId);
 		if (index == -1)
 		{
-			throw new MarkupException("Markup does not contain a fragment with id=" + markupId
-					+ "; Component: " + toString());
+			throw new MarkupException("Markup of component class `"
+					+ providerMarkupStream.getContainerClass().getName()
+					+ "` does not contain a fragment with id `" + markupId + "`. Context: "
+					+ toString());
 		}
 
 		// Set the markup stream position to where the fragment begins