I found out that AjaxSubmitButton is not working with <button> html
tags. I didn't see a reason why not to allow that, so I tried to
create a patch, but I failed miserably. Can anyone please look into
it, or at least give me a hint what I'm doing wrong with my patch. I'm
trying to put this chunk of code:
protected void onComponentTag(ComponentTag tag)
{
final String tagName = tag.getName().toLowerCase();
if (!(tagName.equals("input") || tagName.equals("button")))
{
findMarkupStream().throwMarkupException(
"Component " + getId() + " must be
applied to a tag of type " +
"'input' or 'button',
not " + tag.toUserDebugString());
}
final String type = tag.getAttributes().getString("type");
if (!"button".equals(type) && !"image".equals(type) &&
!"submit".equals(type))
{
findMarkupStream().throwMarkupException(
"Component " + getId() + " must be
applied to a tag with 'type'"
+ " attribute matching
'submit', 'button' or 'image', not '" + type
+ "'");
}
super.onComponentTag(tag);
}
It fails when I try to use the following markup:
<button wicket:id="contactButtonSave" type="submit"><wicket:message
key="manageContacts.save">[Save]</wicket:message></button>
And the exception:
14:59:29.243 ERROR! [SocketListener0-1]
wicket.ajax.AjaxRequestTarget.respond(AjaxRequestTarget.java:379) >24>
Error while responding to an AJAX request:
[EMAIL PROTECTED] markupIdToComponent
[{createFormContainer=[MarkupContainer [Component id =
createFormContainer, page =
com.agent25.rebirth.web.pages.ManageContacts, path =
2:createFormContainer.WebMarkupContainer, isVisible = true,
isVersioned = false]]}], prependJavascript [[]], appendJavascript [[]]
wicket.markup.MarkupException: Expected close tag for <button
type="submit" wicket:id="contactButtonSave" onclick="var
wcall=wicketSubmitFormById('createFormContainer_saveContact',
'/web/app?wicket:interface=wicket-2:2:createFormContainer:saveContact:contactButtonSave:-1:IUnversionedBehaviorListener&wicket:behaviorId=0&wicket:ignoreIfNotActive=true',
null, function() { }, function() { });;; return false;"
id="createFormContainer_saveContact_contactButtonSave">
[markup =
file:/home/aquarius/dev/workspace/web/target/classes/com/agent25/rebirth/web/pages/ManageContacts.html,
index = 107, current = '<wicket:message key="manageContacts.save">'
(line 68, column 62)]
at
wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:290)
at wicket.Component.renderClosingComponentTag(Component.java:2965)
at wicket.Component.renderComponent(Component.java:1705)
at wicket.markup.html.WebComponent.onRender(WebComponent.java:61)
at wicket.Component.render(Component.java:1533)
at wicket.MarkupContainer.renderNext(MarkupContainer.java:1334)
at
wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:982)
at wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:917)
at wicket.markup.html.form.Form.onComponentTagBody(Form.java:773)
at wicket.Component.renderComponent(Component.java:1697)
at wicket.MarkupContainer.onRender(MarkupContainer.java:927)
I would be grateful if someone can hint me on it. I understand what
the exception means, but I don't get why it is thrown, since <button>
has a close tag. Thanks in advance.
- Stefan
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user