[
https://issues.apache.org/jira/browse/WICKET-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13541056#comment-13541056
]
Christof Van Hove commented on WICKET-4949:
-------------------------------------------
This was indeed the solution. Thank you for your prompt and correct response
> AjaxEventBehavior breaks browser event bubbling
> -----------------------------------------------
>
> Key: WICKET-4949
> URL: https://issues.apache.org/jira/browse/WICKET-4949
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 6.4.0
> Environment: jetty, windows 7
> Reporter: Christof Van Hove
>
> Click events seem to stop working for the document when there is an
> AjaxEventBehavior attached to the clicked label.
> Consider the code below. I expect the alert message 'clicked on document'
> also to appear when I click on the label with the AjaxEventBehavior attached
> wicket version is 6.4
> <html xmlns:wicket="http://www.w3.org/1999/xhtml">
> <head>
> <title>TEST PAGE</title>
> </head>
> <body >
> <span wicket:id="label1"/><br>
> <span id="label2">Label2</span><br>
> </body>
> </html>
> public class TestPage extends WebPage {
> public TestPage() {
> Label label1 = new Label("label1", "label1");
> label1.setOutputMarkupId(true);
> label1.add(new AjaxEventBehavior("click") {
> @Override
> protected void onEvent(AjaxRequestTarget target) {
> System.out.println("clicked on label");
> }
> });
> add(label1);
> }
> @Override
> public void renderHead(IHeaderResponse response) {
> super.renderHead(response);
> response.render(OnLoadHeaderItem.forScript(new StringBuilder()
> .append("$(document).click(function(e) {alert('clicked on
> document');});")
> .append("$('#label2').on('click', function(e) {alert('clicked on
> label');}); ")
> .toString()));
> }
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira