final FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK);
feedback.setOutputMarkupId(true);
addOrReplace(feedback);
final Config config = new Config();
config.setSelectable(true);
config.setSelectHelper(false);
final Collection<ObjectAdapter> entityList = model.getObject();
final Iterable<String> calendarNames = getCalendarNames(entityList);
int i=0;
for (final String calendarName: calendarNames) {
final EventSource namedCalendar = new EventSource();
namedCalendar.setTitle(calendarName);
namedCalendar.setEventsProvider(newEventProvider(model, calendarName));
namedCalendar.setEditable(true);
String color = COLORS[i++ % COLORS.length];
namedCalendar.setBackgroundColor(color);
namedCalendar.setBorderColor(color);
config.add(namedCalendar);
}
config.setAspectRatio(2.5f);
config.getHeader().setLeft("prevYear,prev,next,nextYear, today");
config.getHeader().setCenter("title");
config.getHeader().setRight("");
config.setLoading("function(bool) { if (bool) $(\"#loading\").show(); else $(\"#loading\").hide(); }");
config.setAllDaySlot(true);
final FullCalendar calendar = new FullCalendarWithEventHandling(ID_FULL_CALENDAR, config, feedback);
addOrReplace(calendar);
addOrReplace(new EventSourceSelector(ID_SELECTOR, calendar));