I'm trying to create an agenda with jsf. I looked on prime faces' website but I didn't catch how it works, even when I copied the code available on the website. I also made some research here and on google but I found nothing working for me.
So I tried to make the most simple exemple :
In my .xhtml :
<p:schedule value="#{agendaControl.planning}">
</p:schedule>
In my .java file :
@Named
@ViewScoped
@Stateful(passivationCapable=true)
public class AgendaControl {
private ScheduleModel planning;
@PostConstruct
public void init() {
System.out.println("test");
planning = new DefaultScheduleModel();
DefaultScheduleEvent<?> event = DefaultScheduleEvent.builder()
.title("test")
.startDate(LocalDateTime.now())
.build();
planning.addEvent(event);
}
public ScheduleModel getPlanning() {
return planning;
}
public void setPlanning(ScheduleModel planning) {
this.planning = planning;
}
}
I would like to know what am I doing wrong and how should I use p:schedule to make it work fine ?
Thank you in advance for your help and any tips. I might have some beginner errors in my code, as I never used jsf before.
EDIT :
I looked on this stackoverflow question, to see if my @PostConstruct annotated method worked, and yes it is. I have my "test" event in my planning variable.