}
protected Object createSubmitEventFunction(FacesContext context, AbstractSchedule component) {
ScriptString jsFunction;
Map<String, Object> params = new HashMap<String, Object>();
params.put(getFieldId(context, component, START_DATE_PARAM), new JSReference(START_DATE_PARAM));
params.put(getFieldId(context, component, END_DATE_PARAM), new JSReference(END_DATE_PARAM));
params.put(getFieldId(context, component, ITEM_ID_PARAM), new JSReference(ITEM_ID_PARAM));
params.put(getFieldId(context, component, DAY_DELTA_PARAM), new JSReference(DAY_DELTA_PARAM));
params.put(getFieldId(context, component, MINUTE_DELTA_PARAM), new JSReference(MINUTE_DELTA_PARAM));
params.put(getFieldId(context, component, ALL_DAY_PARAM), new JSReference(ALL_DAY_PARAM));
params.put(getFieldId(context, component, EVENT_TYPE_PARAM), new JSReference(EVENT_TYPE_PARAM));
params.put(getFieldId(context, component, VIEW_PARAM), new JSReference(VIEW_PARAM));
String clientId = component.getClientId();
params.put(clientId, clientId);
if (isAjaxMode(component)) {
AjaxFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(context, component);
ajaxFunction.getOptions().getParameters().putAll(params);
ajaxFunction.getOptions().set("complete", new JSReference(CALLBACK));
jsFunction = ajaxFunction;
} else if (SwitchType.server.equals(component.getSwitchType())) {
jsFunction = new JSFunction("RichFaces.submitForm", "#"
+ RendererUtils.getInstance().getNestingForm(component).getClientId(context),
params,