Hi everyone! I have next situation: I open ModalWindow and show in it several Panels by clicking on button - and I need to attach some JavaScript on viewing concrete Panel. How can I do it?
I tried to add Behavior on 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+") }); ");
}
});
but it doesn't work :(