/** * * @return event handler */ protected CharSequence getEventHandler() { CharSequence handler = getCallbackScript(); if (event.equalsIgnoreCase("href")) { handler = "javascript:" + handler; } return handler; }
/** * * @return event handler */ protected CharSequence getEventHandler() { CharSequence handler = getCallbackScript(); if (event.equalsIgnoreCase("href")) { handler = "javascript:" + handler; } return handler; }
@Override public void renderHead(final Component component, final IHeaderResponse response) { super.renderHead(component, response); if (component.isEnabledInHierarchy()) { CharSequence js = getCallbackScript(component); response.render(OnDomReadyHeaderItem.forScript(js.toString())); } }
@Override public void renderHead(final Component component, final IHeaderResponse response) { super.renderHead(component, response); if (component.isEnabledInHierarchy()) { CharSequence js = getCallbackScript(component); response.render(OnDomReadyHeaderItem.forScript(js.toString())); } }
@Override protected void onAfterRender() { super.onAfterRender(); // The sentence list is refreshed using AJAX. Unfortunately, the renderHead() method // of the AjaxEventBehavior created by AjaxLink does not seem to be called by Wicket // during an AJAX rendering, causing the sentence links to loose their functionality. // Here, we ensure that the callback scripts are attached to the sentence links even // during AJAX updates. if (isEnabledInHierarchy()) { RequestCycle.get().find(AjaxRequestTarget.class).ifPresent(_target -> { for (AjaxEventBehavior b : getBehaviors(AjaxEventBehavior.class)) { _target.appendJavaScript(b.getCallbackScript()); } }); } }
@Override protected void onAfterRender() { super.onAfterRender(); // The sentence list is refreshed using AJAX. Unfortunately, the renderHead() method // of the AjaxEventBehavior created by AjaxLink does not seem to be called by Wicket // during an AJAX rendering, causing the sentence links to loose their functionality. // Here, we ensure that the callback scripts are attached to the sentence links even // during AJAX updates. if (isEnabledInHierarchy()) { RequestCycle.get().find(AjaxRequestTarget.class).ifPresent(_target -> { for (AjaxEventBehavior b : getBehaviors(AjaxEventBehavior.class)) { _target.appendJavaScript(b.getCallbackScript()); } }); } }