I'd like to change the color of an event on schedule. After googling, I found those links: primefaces schedule event color is not working after replacing Primefaces Jar 3.3 by 4.0 and Change the color of primefaces Scheduler Event . But neither of them worked for me.
This is the HTML page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
<meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
<title>SARSOURA | Appoint a Meeting</title>
</f:facet>
<link rel="shortcut icon" type="image/x-icon" href="#{resource['icons/hki2.gif']}"/>
<style>
body
{
background: #e6e6e6;
}
</style>
<style type="text/css">
.value
{
width: 900px;
}
</style>
</h:head>
<body>
<h:form>
<center>
<p:growl id="messages" showDetail="true" />
<h:panelGrid columnClasses="value">
<p:schedule id="schedule" value="#{scheduleView.eventModel}" widgetVar="myschedule" timeZone="GMT+2">
<p:ajax event="dateSelect" listener="#{scheduleView.onDateSelect}" update="eventDetails" oncomplete="PF('eventDialog').show();" />
<p:ajax event="eventSelect" listener="#{scheduleView.onEventSelect}" update="eventDetails" oncomplete="PF('eventDialog').show();" />
<p:ajax event="eventMove" listener="#{scheduleView.onEventMove}" update="messages" />
<p:ajax event="eventResize" listener="#{scheduleView.onEventResize}" update="messages" />
</p:schedule>
</h:panelGrid>
<p:dialog widgetVar="eventDialog" header="Event Details" showEffect="clip" hideEffect="clip">
<h:panelGrid id="eventDetails" columns="2">
<p:outputLabel for="title" value="Titles:" />
<p:inputText id="title" value="#{scheduleView.event.title}" required="true" />
<p:outputLabel for="from" value="From:" />
<p:calendar id="from" value="#{scheduleView.event.startDate}" timeZone="GMT+2" pattern="dd/MM/yyyy HH:mm"/>
<p:outputLabel for="to" value="To:" />
<p:calendar id="to" value="#{scheduleView.event.endDate}" timeZone="GMT+2" pattern="dd/MM/yyyy HH:mm"/>
<p:outputLabel for="allDay" value="All Day:" />
<h:selectBooleanCheckbox id="allDay" value="#{scheduleView.event.allDay}" />
<p:commandButton type="reset" value="Reset" />
<p:commandButton id="addButton" value="Save" actionListener="#{scheduleView.addNewEvent}" oncomplete="PF('myschedule').update();PF('eventDialog').hide();" />
</h:panelGrid>
</p:dialog>
</center>
</h:form>
</body>
<p:graphicImage value="/resources/icons/Footer.png" style="text-align:center"/>
</html>
And this is what I put on the bean ScheduleView.java:
eventModel.addEvent(new DefaultScheduleEvent("Teaching", samiaFridaySA1(), samiaFridaySA2(),"emp1"));
On the file style.css, I have:
.emp1 .fc-event-inner {
background: red;
}
Have you please any idea about solving this problem. Any suggestion is appreciated.Thanks a lot.