response.appendContentString("</" + elementName + ">");
addRequiredWebResources(response, context);
// super.appendToResponse(response, context);
NSDictionary options = createAjaxOptions(component);
Object frequency = valueForBinding("frequency", component);
String observeFieldID = (String) valueForBinding("observeFieldID", component);
boolean skipFunction = frequency == null && observeFieldID == null && booleanValueForBinding("skipFunction", false, component);
if(!skipFunction) {
AjaxUtils.appendScriptHeader(response);
if(frequency != null) {
boolean isNotZero = true;
try {
float numberFrequency = ERXValueUtilities.floatValue(frequency);
if(numberFrequency == 0.0) {
isNotZero = false;
}
} catch (RuntimeException e) {
throw new IllegalStateException("Error parsing float from value : <" + frequency + ">");
}
if(isNotZero) {
boolean canStop = false;
boolean stopped = false;
if(associations().objectForKey("stopped") != null) {
canStop = true;
stopped = booleanValueForBinding("stopped", false, component);
}
response.appendContentString("MTAUC.registerPeriodic('" + id + "'," + canStop + "," + stopped + ",");
AjaxOptions.appendToResponse(options, response, context);
response.appendContentString(");");
}
}
if(observeFieldID != null) {
boolean fullSubmit = booleanValueForBinding("fullSubmit", false, component);
AjaxObserveField.appendToResponse(response, context, this, observeFieldID, false, id, fullSubmit, createObserveFieldOptions(component));
}
response.appendContentString("MTAUC.register('" + id + "'");
NSDictionary nonDefaultOptions = AjaxUpdateContainer.removeDefaultOptions(options);
if (nonDefaultOptions.count() > 0) {
response.appendContentString(", ");
AjaxOptions.appendToResponse(nonDefaultOptions, response, context);
}
response.appendContentString(");");