Iterable<String> render = getRender();
Iterable<String> execute = getExecute();
final Chart chart = (Chart) getParent();
if (render != null || (execute != null && execute.iterator().hasNext())) {
AjaxInitializer initializer = new AjaxInitializer();
JSONObject ajaxParams = initializer.getAjaxParams(context, this);
MethodExpression actionExpression = getActionExpression();
if (actionExpression != null) {
String expr = actionExpression.getExpressionString().trim();
if (!expr.startsWith("#{")) throw new FacesException("<o:selection> action expression is expected to start with #{ symbols: " + expr);
expr = expr.substring(2, expr.length() - 1);
try {
ajaxParams.put("_action", expr);
} catch (JSONException e) {
throw new RuntimeException(e);
}
}
automaticChangeHandler = new ScriptBuilder().functionCall("O$._ajaxReload",
initializer.getRenderArray(context, this, render),
ajaxParams).semicolon().append("return false;");
} else {
MethodExpression actionExpression = getActionExpression();
if (actionExpression != null) {
automaticChangeHandler = new ScriptBuilder().functionCall("O$.submitWithParam",