* @author Dmitry Pikhulya
*/
public abstract class OUIClientActionRendererHelper {
public void encodeAutomaticInvocationMode(FacesContext context, OUIClientAction clientAction) throws IOException {
String invokerId = OUIClientActionHelper.getClientActionInvoker(context, clientAction, true);
ScriptBuilder javaScript = new ScriptBuilder();
if (invokerId != null) {
javaScript.functionCall("O$.byIdOrName", invokerId).dot();
javaScript.append(Rendering.getEventWithOnPrefix(context, clientAction, null)).append("=");
javaScript.anonymousFunction(getClientActionScript(context, clientAction), "event").semicolon();
}
encodeAdditionalScript(context, javaScript, clientAction);
AjaxUtil.renderAjaxSupport(context);
Rendering.renderInitScript(context, new ScriptBuilder().onLoadScript(javaScript).semicolon());
}