You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jb...@apache.org on 2007/04/26 00:51:10 UTC

svn commit: r532516 - /incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/AbstractLink.java

Author: jbq
Date: Wed Apr 25 15:51:09 2007
New Revision: 532516

URL: http://svn.apache.org/viewvc?view=rev&rev=532516
Log:
WICKET-481 Take into account the button and input tags in AbstractLink#disableLink()

Modified:
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/AbstractLink.java

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/AbstractLink.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/AbstractLink.java?view=diff&rev=532516&r1=532515&r2=532516
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/AbstractLink.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/AbstractLink.java Wed Apr 25 15:51:09 2007
@@ -151,10 +151,10 @@
 	 *            the markup stream
 	 * @param openTag
 	 *            the open part of this tag
-	 * @see org.apache.wicket.Component#onComponentTagBody(MarkupStream, ComponentTag)
+	 * @see org.apache.wicket.Component#onComponentTagBody(MarkupStream,
+	 *      ComponentTag)
 	 */
-	protected void onComponentTagBody(final MarkupStream markupStream,
-			final ComponentTag openTag)
+	protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
 	{
 		// Draw anything before the body?
 		if (!isLinkEnabled() && getBeforeDisabledLink() != null)
@@ -193,6 +193,12 @@
 			tag.remove("href");
 
 			tag.remove("onclick");
+		}
+		// if the tag is a button or input
+		else if ("button".equalsIgnoreCase(tag.getName())
+				|| "input".equalsIgnoreCase(tag.getName()))
+		{
+			tag.put("disabled", "disabled");
 		}
 	}
 }