Look at the following snippet.
add(new AjaxEventBehavior("onclick") {
private boolean toggle = false;
@Override
protected void onEvent(AjaxRequestTarget target)
{
log.debug("onEvent: " + toggle);
if (toggle)
{
toggle = false;
target.prependJavaScript("toogle(true)");
}
else
{
toggle = true;
target.prependJavaScript("toogle(false)");
}
}
});
But after the page rendering [no errors, warnings], I could see no event associated to the DOM [verified by means of firebug]. Even the debug log was never printed.
Is there any option in wicket to verify the behavior is added or not?
You should iterate trougth Behaviors added to this component to verify your one is added: