addPresentationComponent(vc.getComponent(), vc.getParentForm(), bubbleIndex, vp);
}
if (!vp.getClientValidationRuleForComponent(vc).equals(ClientValidationMode.OFF)) {
List<String> javascriptLibraries = vc.getJavascriptLibrariesUrls();
String[] javascriptLibrariesArray = javascriptLibraries.toArray(new String[javascriptLibraries.size()]);
Rendering.renderInitScript(context, new RawScript(commonScript.toString()), javascriptLibrariesArray);
}
if (clientValidationRuleForComponent.equals(ClientValidationMode.ON_SUBMIT)) {
String formClientId = parentForm.getClientId(context);
if (!formsHaveOnSubmitRendered.contains(formClientId)) {
Rendering.renderInitScript(context,
new RawScript("O$.addOnSubmitEvent(O$._autoValidateForm,'" + formClientId + "');\n"),
ValidatorUtil.getValidatorUtilJsUrl(context));
formsHaveOnSubmitRendered.add(formClientId);
}
} else if (clientValidationRuleForComponent.equals(ClientValidationMode.ON_DEMAND)) {
Rendering.renderInitScript(context,
new RawScript("O$.addNotValidatedInput('" + vc.getClientId() + "');"),
ValidatorUtil.getValidatorUtilJsUrl(context));
}
}