So here's the scenario: I've opened a ModalWindow and displayed multiple Panels in it by clicking on a button - now I need to apply some JavaScript specifically to one of those Panels. How can I accomplish this?
I attempted to add a Behavior to my Panel:
add(new AbstractBehavior() {
private static final long serialVersionUID = 1L;
@Override
public void renderHead(IHeaderResponse response) {
String js = "function myFunction(parameter) { alert('asdasd1'); }";
response.renderJavascript(js, null);
response.renderOnDomReadyJavascript("$(document).ready(function() { alert('test2'); myFunction("+paramsFromWicket+") }); ");
}
});
Unfortunately, it seems like it's not working as expected :(