[
https://issues.apache.org/jira/browse/WICKET-4949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christof Van Hove updated WICKET-4949:
--------------------------------------
Description:
click events seem to stop working voor the document when there is an ajax event
behaviour attached
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()));
}
}
was:
click events seem to stop working voor the document when there is an ajax event
behaviour attached
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("/n/r")
.append("$('#label2').on('click', function(e) {alert('clicked on
label');}); ")
.toString()));
}
}
> AjaxEventBehavior breaks browser event bubbling
> -----------------------------------------------
>
> Key: WICKET-4949
> URL: https://issues.apache.org/jira/browse/WICKET-4949
> Project: Wicket
> Issue Type: Bug
> Reporter: Christof Van Hove
>
> click events seem to stop working voor the document when there is an ajax
> event behaviour attached
> 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