public void renderHead(IHeaderResponse response) {
super.renderHead(response);
AjaxRequestTarget target = getRequestCycle().find(AjaxRequestTarget.class);
if (target != null) {
target.appendJavaScript(javaScriptMarkup);
target.appendJavaScript(javaScriptAddDatepicker);
} else {
response.render(JavaScriptHeaderItem.forScript(javaScriptMarkup, this.getId()));
}
}