/** * @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 + ");"; }
/** * @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 + ");"; }
/** * <pre> * { * u: 'editable-label?6-1.IBehaviorListener.0-text1-label', // url * m: 'POST', // method name. Default: 'GET' * c: 'label7', // component id (String) or window for page * e: 'click', // event name * sh: [], // list of success handlers * fh: [], // list of failure handlers * pre: [], // list of preconditions. If empty set default : Wicket.$(settings{c}) !== null * ep: {}, // extra parameters * async: true|false, // asynchronous XHR or not * ch: 'someName|d', // AjaxChannel * i: 'indicatorId', // indicator component id * ad: true, // allow default * } * </pre> * * @param component * the component with that behavior * @return the attributes as string in JSON format */ protected final CharSequence renderAjaxAttributes(final Component component) { AjaxRequestAttributes attributes = getAttributes(); return renderAjaxAttributes(component, attributes); }
/** * <pre> * { * u: 'editable-label?6-1.IBehaviorListener.0-text1-label', // url * m: 'POST', // method name. Default: 'GET' * c: 'label7', // component id (String) or window for page * e: 'click', // event name * sh: [], // list of success handlers * fh: [], // list of failure handlers * pre: [], // list of preconditions. If empty set default : Wicket.$(settings{c}) !== null * ep: {}, // extra parameters * async: true|false, // asynchronous XHR or not * ch: 'someName|d', // AjaxChannel * i: 'indicatorId', // indicator component id * ad: true, // allow default * } * </pre> * * @param component * the component with that behavior * @return the attributes as string in JSON format */ protected final CharSequence renderAjaxAttributes(final Component component) { AjaxRequestAttributes attributes = getAttributes(); return renderAjaxAttributes(component, attributes); }
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 = ");