if (_model != null) initDataListener();
}
public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
final String cmd = request.getCommand();
final JSONArray data = (JSONArray) request.getData().get("data");
boolean onEvtCreate = cmd.equals("onEventCreate");
if (onEvtCreate || cmd.equals("onEventEdit") || cmd.equals("onEventUpdate")) {
int fieldNum = 6;
if (cmd.equals("onEventEdit")) fieldNum--;
if (cmd.equals("onEventUpdate")) fieldNum++;
final Calendars cmp = Util.verifyEvent(this, request, data, fieldNum);
CalendarEvent ce = null;
if (!cmd.equals("onEventCreate"))
ce = cmp.getCalendarEventById(String.valueOf(data.get(0)));
if (onEvtCreate || ce != null)
Events.postEvent(Util.createCalendarsEvent(cmd, cmp, ce, data));
} else if (cmd.equals("onDayClick") || cmd.equals("onWeekClick")) {
final Calendars cmp = Util.verifyEvent(this, request, data, 1);
Events.postEvent(new Event(cmd, cmp, new Date(Long.parseLong(String.valueOf(data.get(0))))));
} else super.service(request, everError);
}