/** * @return an optional javascript expression that determines whether the request will actually * execute (in form of return XXX;); */ protected CharSequence getPreconditionScript() { if (getComponent() instanceof Page) { return "return true;"; } else { return "return Wicket.$('" + getComponent().getMarkupId() + "') != null;"; } }
/** * @return an optional javascript expression that determines whether the request will actually * execute (in form of return XXX;); */ protected CharSequence getPreconditionScript() { if (getComponent() instanceof Page) { return "return true;"; } else { return "return Wicket.$('" + getComponent().getMarkupId() + "') != null;"; } }
/** * @return javascript that will generate an ajax GET request to this behavior with its assigned * component */ public CharSequence getCallbackScript() { return getCallbackScript(getComponent()); }
/** * @return javascript that will generate an ajax GET request to this behavior with its assigned * component */ public CharSequence getCallbackScript() { return getCallbackScript(getComponent()); }
/** * Subclasses should call super.onBind() * * @see org.apache.wicket.behavior.AbstractAjaxBehavior#onBind() */ protected void onBind() { getComponent().setOutputMarkupId(true); }
/** * Subclasses should call super.onBind() * * @see org.apache.wicket.behavior.AbstractAjaxBehavior#onBind() */ @Override protected void onBind() { getComponent().setOutputMarkupId(true); }
/** * Finds the markup id of the indicator. The default search order is: component, behavior, * component's parent hierarchy. * * @return markup id or <code>null</code> if no indicator found */ protected String findIndicatorId() { if (getComponent() instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)getComponent()).getAjaxIndicatorMarkupId(); } if (this instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)this).getAjaxIndicatorMarkupId(); } Component parent = getComponent().getParent(); while (parent != null) { if (parent instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)parent).getAjaxIndicatorMarkupId(); } parent = parent.getParent(); } return null; }
/** * * @return String */ private String findIndicatorId() { if (getComponent() instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)getComponent()).getAjaxIndicatorMarkupId(); } if (this instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)this).getAjaxIndicatorMarkupId(); } Component parent = getComponent().getParent(); while (parent != null) { if (parent instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)parent).getAjaxIndicatorMarkupId(); } parent = parent.getParent(); } return null; }
/** * Finds the markup id of the indicator. The default search order is: component, behavior, * component's parent hierarchy. * * @return markup id or <code>null</code> if no indicator found */ protected String findIndicatorId() { if (getComponent() instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)getComponent()).getAjaxIndicatorMarkupId(); } if (this instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)this).getAjaxIndicatorMarkupId(); } Component parent = getComponent().getParent(); while (parent != null) { if (parent instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)parent).getAjaxIndicatorMarkupId(); } parent = parent.getParent(); } return null; }
/** * Finds the markup id of the indicator. The default search order is: component, behavior, * component's parent hieararchy. * * @return markup id or <code>null</code> if no indicator found */ protected String findIndicatorId() { if (getComponent() instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)getComponent()).getAjaxIndicatorMarkupId(); } if (this instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)this).getAjaxIndicatorMarkupId(); } Component parent = getComponent().getParent(); while (parent != null) { if (parent instanceof IAjaxIndicatorAware) { return ((IAjaxIndicatorAware)parent).getAjaxIndicatorMarkupId(); } parent = parent.getParent(); } return null; }
@Override public final void onRequest() { WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage()); RequestCycle requestCycle = RequestCycle.get(); requestCycle.scheduleRequestHandlerAfterCurrent(target); respond(target); }
/** * @see org.apache.wicket.behavior.IBehaviorListener#onRequest() */ public final void onRequest() { WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage()); RequestCycle.get().setRequestTarget(target); respond(target); }
@Override public final void onRequest() { WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage()); RequestCycle requestCycle = RequestCycle.get(); requestCycle.scheduleRequestHandlerAfterCurrent(target); respond(target); }
/** * @see org.apache.wicket.behavior.IBehaviorListener#onRequest() */ public final void onRequest() { WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage()); RequestCycle.get().setRequestTarget(target); respond(target); }
/** * Subclasses should call super.onBind() * * @see org.apache.wicket.behavior.AbstractAjaxBehavior#onBind() */ @Override protected void onBind() { final Component component = getComponent(); component.setOutputMarkupId(true); if (getStatelessHint(component)) { //generate behavior id component.getBehaviorId(this); } }
/** * Subclasses should call super.onBind() * * @see org.apache.wicket.behavior.AbstractAjaxBehavior#onBind() */ @Override protected void onBind() { final Component component = getComponent(); component.setOutputMarkupId(true); if (getStatelessHint(component)) { //generate behavior id component.getBehaviorId(this); } }
CharSequence attrsJson = renderAjaxAttributes(getComponent(), attributes); StringBuilder sb = new StringBuilder(); sb.append("var attrs = ");
CharSequence attrsJson = renderAjaxAttributes(getComponent(), attributes); StringBuilder sb = new StringBuilder(); sb.append("var attrs = ");
/** * @return the Ajax settings for this behavior * @since 6.0 */ protected final AjaxRequestAttributes getAttributes() { AjaxRequestAttributes attributes = new AjaxRequestAttributes(); WebApplication application = (WebApplication)getComponent().getApplication(); AjaxRequestTargetListenerCollection ajaxRequestTargetListeners = application .getAjaxRequestTargetListeners(); for (AjaxRequestTarget.IListener listener : ajaxRequestTargetListeners) { listener.updateAjaxAttributes(this, attributes); } updateAjaxAttributes(attributes); return attributes; }
/** * @return the Ajax settings for this behavior * @since 6.0 */ protected final AjaxRequestAttributes getAttributes() { AjaxRequestAttributes attributes = new AjaxRequestAttributes(); WebApplication application = (WebApplication)getComponent().getApplication(); AjaxRequestTargetListenerCollection ajaxRequestTargetListeners = application .getAjaxRequestTargetListeners(); for (AjaxRequestTarget.IListener listener : ajaxRequestTargetListeners) { listener.updateAjaxAttributes(this, attributes); } updateAjaxAttributes(attributes); return attributes; }