I want to have a feature such that when the user clicks on a Date, the calendar will render the agendaDay view of that Date. I tried as following:
<p:schedule id="timetable" widgetVar="mySchedule" editable="true"
allDaySlot="false" value="#{cc.attrs.managedBean.eventModel}"
dateSelectListener="#{mrBean.onDateSelect}"
onDateSelectUpdate="timetable"
initialDate="#{mrBean.initialDate}"
view="#{mrBean.view}">
</p:schedule>
And this is my ManagedBean:
@Named(value = "mrBean")
@RequestScoped
public class MrBean {
private ScheduleModel eventModel;
private String view;
private Date initialDate;
public MrBean() {
eventModel = new DefaultScheduleModel();
}
public void onDateSelect(DateSelectEvent selectEvent) {
view = "agendaDay";
initialDate = selectEvent.getDate();
}
// Getters and Setters
}
When I try to click on a Date, the whole calendar disappeared and I saw this string {"events" : []} on the browser.
I’d be very grateful if someone could show me where I have done wrong.
Best regards,
James Tran
http://forum.primefaces.org/viewtopic.php?f=3&t=1949
This sums it up nicely. It is used for the initial load, but beyond that it isn’t functional. You can look to 3.0M4 which has a new model (and better model) for the schedule or you can do something sneaky like override the FC Calendar it is built on
http://www.planbox.com/blog/development/coding/full-calendar-jquery-widget-simply-awesome.html
via the “widgetVar” attribute so that when you fire a particular click it switches views. To be honest, that’s probably faster as well as it would happen client side and it already has all the data.