Peter Franza created WICKET-6843:
------------------------------------

             Summary: Using WicketMessageTagHandler on non-components prevents 
Ajax behaviors
                 Key: WICKET-6843
                 URL: https://issues.apache.org/jira/browse/WICKET-6843
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 8.0.0
            Reporter: Peter Franza


Inclusion of the wicket:message attribute on non-component markup prevents any 
children that have ajax behaviors to not get bound in after render.

In the code below the markup will render correctly, however there will not be 
any click event bound to the link. If the `wicket:message` tag is removed from 
the div everything will work correctly. Additionally if the a `wicket:id` is 
added to the div, and the div is treated as a component, then everything will 
also work.

*Example code*

Source:
{code:java}
public class TestPage extends WebPage {
        public TestPage(PageParameters p) {
                super(p);
                queue(new AjaxLink("link") {
                        @Override
                        public void onClick(AjaxRequestTarget target) {
                                target.appendJavaScript("alert('click');");
                        }
                });
        }
}
{code}
Markup:
{code:java}
<!DOCTYPE html>
<html>
<head>
 <wicket:header-items/>
</head>
<body >
        <div wicket:message="label:mainNav">
                <a wicket:id="link">Click Me</a>
        </div>
</body>
</html>
{code}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to