/** * Gets the data-provider behavior's url * * @return the data-provider behavior's url */ protected final CharSequence getCallbackUrl() { return this.providerBehavior.getCallbackUrl(); }
/** * Bind this handler to the given component. * * @param hostComponent * the component to bind to */ @Override public final void bind(final Component hostComponent) { if (hostComponent == null) { throw new IllegalArgumentException("Argument hostComponent must be not null"); } if (component != null) { throw new IllegalStateException("this kind of handler cannot be attached to " + "multiple components; it is already attached to component " + component + ", but component " + hostComponent + " wants to be attached too"); } component = hostComponent; // call the callback onBind(); }
/** * @see org.apache.wicket.behavior.AbstractBehavior#onRendered(org.apache.wicket.Component) */ public final void onRendered(final Component hostComponent) { onComponentRendered(); }
@Override public void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); renderScripts(response); renderWidgetConfig(response, configureParameters(component)); }
@Override public final void onComponentTag(final Component component, final ComponentTag tag) { onComponentTag(tag); }
/** * Gets the url that references this handler. * * @param onlyTargetActivePage * if true the callback to this behavior will be ignore if the page is not the last * one the user accessed * * @return the url that references this handler */ public CharSequence getCallbackUrl(final boolean onlyTargetActivePage) { if (getComponent() == null) { throw new IllegalArgumentException( "Behavior must be bound to a component to create the URL"); } final RequestListenerInterface rli; if (onlyTargetActivePage) { rli = IActivePageBehaviorListener.INTERFACE; } else { rli = IBehaviorListener.INTERFACE; } return getComponent().urlFor(this, rli); }
@Override public void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); response.render(OnDomReadyHeaderItem.forScript(getKeepAliveScript().asString(getKeepAliveParametersMap()))); }
@Override public final void onComponentTag(final Component component, final ComponentTag tag) { onComponentTag(tag); }
/** * Gets the url that references this handler. * * @param onlyTargetActivePage * if true the callback to this behavior will be ignore if the page is not the last * one the user accessed * * @return the url that references this handler */ public CharSequence getCallbackUrl(final boolean onlyTargetActivePage) { if (getComponent() == null) { throw new IllegalArgumentException( "Behavior must be bound to a component to create the URL"); } final RequestListenerInterface rli; if (onlyTargetActivePage) { rli = IActivePageBehaviorListener.INTERFACE; } else { rli = IBehaviorListener.INTERFACE; } return getComponent().urlFor(this, rli); }
/** * Gets the data-provider behavior's url * * @return the data-provider behavior's url */ protected final CharSequence getCallbackUrl() { return this.providerBehavior.getCallbackUrl(); }
@Override public void renderHead(final Component component, final IHeaderResponse response) { super.renderHead(component, response); response.render(CssHeaderItem.forReference(TAG_IT_CSS)); response.render(JavaScriptHeaderItem.forReference(getComponent().getApplication().getJavaScriptLibrarySettings().getJQueryReference())); response.render(JavaScriptHeaderItem.forReference(new UrlResourceReference(Url.parse("//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js")))); response.render(JavaScriptHeaderItem.forReference(TAG_IT_JS)); component.setOutputMarkupId(true); String id = component.getMarkupId(); TextTemplate tagItConfig = getTagItConfig(); Map<String, CharSequence> variables = new HashMap<String, CharSequence>(); variables.put("componentId", id); variables.put("callbackUrl", getCallbackUrl()); String script = tagItConfig.asString(variables); response.render(OnDomReadyHeaderItem.forScript(script)); }
/** * @see org.apache.wicket.behavior.IBehavior#onComponentTag(org.apache.wicket.Component, * org.apache.wicket.markup.ComponentTag) */ public final void onComponentTag(final Component component, final ComponentTag tag) { onComponentTag(tag); }
@Override public final void afterRender(final Component hostComponent) { onComponentRendered(); }
/** * Bind this handler to the given component. * * @param hostComponent * the component to bind to */ public final void bind(final Component hostComponent) { if (hostComponent == null) { throw new IllegalArgumentException("Argument hostComponent must be not null"); } if (component != null) { throw new IllegalStateException("this kind of handler cannot be attached to " + "multiple components; it is already attached to component " + component + ", but component " + hostComponent + " wants to be attached too"); } component = hostComponent; // call the callback onBind(); }
/** * Gets the url that references this handler. * * @return the url that references this handler */ public CharSequence getCallbackUrl() { Component component = getComponent(); if (component == null) { throw new IllegalArgumentException( "Behavior must be bound to a component to create the URL"); } PageParameters parameters = new PageParameters(); PageParameters pageParameters = component.getPage().getPageParameters(); List<INamedParameters.NamedPair> allNamedInPath = pageParameters.getAllNamedByType(INamedParameters.Type.PATH); for (INamedParameters.NamedPair namedPair : allNamedInPath) { parameters.add(namedPair.getKey(), namedPair.getValue(), INamedParameters.Type.PATH); } return getComponent().urlForListener(this, parameters); }
public JsAjaxCallbackFunction(AbstractAjaxBehavior behavior) { super("function() { Wicket.Ajax.get('" + behavior.getCallbackUrl() + "'); }"); } }
/** * @see org.apache.wicket.behavior.AbstractAjaxBehavior#renderHead(Component, * org.apache.wicket.markup.head.IHeaderResponse) */ @Override public void renderHead(final Component component, final IHeaderResponse response) { super.renderHead(component, response); CoreLibrariesContributor.contributeAjax(component.getApplication(), response); RequestCycle requestCycle = component.getRequestCycle(); Url baseUrl = requestCycle.getUrlRenderer().getBaseUrl(); CharSequence ajaxBaseUrl = Strings.escapeMarkup(baseUrl.toString()); response.render(JavaScriptHeaderItem.forScript("Wicket.Ajax.baseUrl=\"" + ajaxBaseUrl + "\";", "wicket-ajax-base-url")); renderExtraHeaderContributors(component, response); }
/** * @see org.apache.wicket.behavior.IBehavior#onComponentTag(org.apache.wicket.Component, * org.apache.wicket.markup.ComponentTag) */ @Override public final void onComponentTag(final Component component, final ComponentTag tag) { onComponentTag(tag); }
@Override public final void afterRender(final Component hostComponent) { onComponentRendered(); }
/** * Bind this handler to the given component. * * @param hostComponent * the component to bind to */ @Override public final void bind(final Component hostComponent) { Args.notNull(hostComponent, "hostComponent"); if (component != null) { throw new IllegalStateException("this kind of handler cannot be attached to " + "multiple components; it is already attached to component " + component + ", but component " + hostComponent + " wants to be attached too"); } component = hostComponent; // call the callback onBind(); }