final ChartPopup popup = (ChartPopup) component;
renderScripts(context, popup);
}
private void renderScripts(FacesContext context, UIComponent component) throws IOException {
final ChartPopup popup = (ChartPopup) component;
final String clientId = popup.getClientId(context);
final boolean clientLoadingMode = popup.getLoadingMode().equals(LoadingMode.CLIENT);
final UIComponent chartView = popup.getParent();
final Chart chart = (Chart) chartView.getParent();
final Integer entityIndex = chart.getEntityIndex();
chart.setEntityIndex(-1);
final String chartId = chart.getClientId(context);
chart.setEntityIndex(entityIndex);
ScriptBuilder buf = new ScriptBuilder();
buf.functionCall("O$.ChartPopup._init", clientId, popup.getLoadingMode().toString(), chartId).semicolon();
Rendering.renderInitScript(context, buf,
Resources.utilJsURL(context),
Resources.internalURL(context, "chart/chart.js"),
(!clientLoadingMode ? Resources.ajaxUtilJsURL(context) : null));