/** * @see org.apache.wicket.ajax.AbstractAjaxTimerBehavior#onTimer(AjaxRequestTarget) */ @Override protected final void onTimer(final AjaxRequestTarget target) { target.add(getComponent()); onPostProcessTarget(target); }
@Override public void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); if (isStopped() == false) { setTimeout(response); } }
/** * @see org.apache.wicket.ajax.AbstractAjaxTimerBehavior#onTimer(org.apache.wicket.ajax.AjaxRequestTarget) */ protected final void onTimer(final AjaxRequestTarget target) { target.addComponent(getComponent()); onPostProcessTarget(target); }
/** * Implement our own ajax event handling in order to update the datatable itself, as the * default implementation doesn't support DataViews. * * @see AjaxPagingNavigator#onAjaxEvent(org.apache.wicket.ajax.AjaxRequestTarget) */ @Override protected void onAjaxEvent(final AjaxRequestTarget target) { target.add(table); } };
AjaxEventBehavior event = new AjaxEventBehavior("onload") { @Override protected void onEvent(final AjaxRequestTarget target) { // do stuff here target.appendJavaScript("alert('onload');"); } } add(event);
protected CharSequence generateCallbackScript(CharSequence partialCall) { CharSequence script = super.generateCallbackScript(partialCall); final ThrottlingSettings ts = throttlingSettings; if (ts != null) { script = AbstractDefaultAjaxBehavior.throttleScript(script, ts.getId(), ts.getDelay()); } return script; }
/** * @return javascript that will generate an ajax GET request to this behavior with its assigned * component */ public CharSequence getCallbackScript() { return getCallbackScript(getComponent()); }
@Override protected final void respond(final AjaxRequestTarget target) { onEvent(target); }
private void assertListenersNotFrozen() { assertNotFrozen(listenersFrozen, AjaxRequestTarget.IListener.class); } }
/** * @see java.lang.Object#toString() */ @Override public String toString() { return "[AjaxRequestHandler@" + hashCode() + " responseObject [" + update + "]"; }
/** * Calculates the ChannelName. * * @return a String in the format channelName|d for DropChannels, channelName|s for Stackable * Channels. */ String getChannelName() { return toString(); }
/** * @param component * the component to use when generating the attributes * @return script that can be used to execute this Ajax behavior. */ // 'protected' because this method is intended to be called by other Behavior methods which // accept the component as parameter protected CharSequence getCallbackScript(final Component component) { CharSequence ajaxAttributes = renderAjaxAttributes(component); return "Wicket.Ajax.ajax(" + ajaxAttributes + ");"; }
/** * Construct. * * @param updateInterval * Duration between AJAX callbacks */ public AbstractAjaxTimerBehavior(final Duration updateInterval) { setUpdateInterval(updateInterval); }
/** * @see org.apache.wicket.ajax.AbstractAjaxTimerBehavior#onTimer(AjaxRequestTarget) */ @Override protected final void onTimer(final AjaxRequestTarget target) { target.add(getComponent()); onPostProcessTarget(target); }
@Override protected void onUpdate(AjaxRequestTarget target) { target.add(table); } });
/** * @see org.apache.wicket.ajax.AbstractAjaxTimerBehavior#onTimer(org.apache.wicket.ajax.AjaxRequestTarget) */ @Override protected final void onTimer(final AjaxRequestTarget target) { target.addComponent(getComponent()); onPostProcessTarget(target); }
@Override public void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); if (isStopped() == false) { setTimeout(response); } }
@Override protected CharSequence generateCallbackScript(CharSequence partialCall) { CharSequence script = super.generateCallbackScript(partialCall); final ThrottlingSettings ts = throttlingSettings; if (ts != null) { script = AbstractDefaultAjaxBehavior.throttleScript(script, ts.getId(), ts.getDelay()); } return script; }
private void assertListenersNotFrozen() { assertNotFrozen(listenersFrozen, AjaxRequestTarget.IListener.class); } }
/** * @see java.lang.Object#toString() */ @Override public String toString() { return "[AjaxRequestHandler@" + hashCode() + " responseObject [" + update + "]"; }