protected InitScript renderInitScript(FacesContext context, ScrollButton scrollButton)
      throws IOException {
    ScriptBuilder buf = new ScriptBuilder();
    JSONObject stylingParams = getStylingParamsObj(context, scrollButton);

    buf.initScript(
        context,
        scrollButton,
        "O$.ScrollButton._init",
        scrollButton.getParent().getClientId(context),
        scrollButton.getScrollDirection().toString(),
        stylingParams);
    return new InitScript(
        buf.toString(),
        new String[] {
          TableUtil.getTableUtilJsURL(context),
          Resources.internalURL(context, "timetable/scrollButton.js")
        });
  }
Esempio n. 2
0
  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));
  }