I'm not sure it is a good solution, but I've made AjaxSubmitButton
inherit from WebMarkupComoponent to allow <button>Foo</button>. I've
also expanded the tag name check to allow button. Works for me now.
Submitting the change as a patch.
Index: .
===================================================================
--- .   (revision 7574)
+++ .   (working copy)
@@ -22,7 +22,7 @@
 import wicket.ajax.IAjaxCallDecorator;
 import wicket.ajax.form.AjaxFormSubmitBehavior;
 import wicket.markup.ComponentTag;
-import wicket.markup.html.WebComponent;
+import wicket.markup.html.WebMarkupContainer;
 import wicket.markup.html.form.Button;
 import wicket.markup.html.form.Form;
 import wicket.util.string.AppendingStringBuffer;
@@ -36,7 +36,7 @@
  * 
  * @author Igor Vaynberg (ivaynberg)
  */
-public abstract class AjaxSubmitButton extends WebComponent
+public abstract class AjaxSubmitButton extends WebMarkupContainer
 {
        private static final long serialVersionUID = 1L;
 
@@ -94,7 +94,14 @@
 
        protected void onComponentTag(ComponentTag tag)
        {
-               checkComponentTag(tag, "input");
+               String tagName = tag.getName();
+               
+               if (!("input".equalsIgnoreCase(tagName) || 
("button".equalsIgnoreCase(tagName))))
+               {
+                       findMarkupStream().throwMarkupException(
+                                       "Component " + getId() + " must be 
applied to a tag of type 'button' " +
+                                                       "or 'input', not " + 
tag.toUserDebugString());
+               }
 
                final String type = tag.getAttributes().getString("type");
                if (!"button".equals(type) && !"image".equals(type) && 
!"submit".equals(type))
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to