Primefaces JAR 3.3後不工作我用primefaces 4.0和我試圖改變Primefaces懶惰附表事件的顏色,所以我有以下XHTML代碼primefaces時間表事件的顏色更換了4.0
<style type="text/css">
.Ajout .fc-event-skin {
background: #00FF00;
}
.Livraison .fc-event-skin {
background:#DF013A;
</style>
<p:schedule value="#{scheduleController.lazyEventModel}" locale="fr" showWeekends="true" eventSelectListener="#{scheduleController.onEventSelect}" >
<p:ajax event="eventSelect" listener="#{scheduleController.onEventSelect}" update="eventDetails" oncomplete="PF('eventDialog').show()" />
</p:schedule>
<p:dialog widgetVar="eventDialog" header="Event Details" showEffect="clip" hideEffect="clip">
<h:panelGrid id="eventDetails" columns="2">
</h:panelGrid>
</p:dialog>
這是支持bean
public class ScheduleController implements Serializable {
private ScheduleModel lazyEventModel;
@Inject CalculDAO calculdao;
@Inject RibhDAO ribhdao;
public ScheduleController() {
lazyEventModel = new LazyScheduleModel() {
@Override
public void loadEvents(Date start, Date end) {
clear();
for(Calcul str: calculdao.DisplayCalculs())
{
Calendar cal = Calendar.getInstance();
Date random1 = getRandomDate1(str.getDate());
Date random2 = getRandomDate2(str.getDate());
addEvent(new DefaultScheduleEvent(""+str.getAjouteroulivr(),random1, random2,str.getAjouteroulivr()));
}
for(Ribh str: ribhdao.DisplayRibh())
{
Date random1 = getRandomDate1(str.getDate());
Date random2 = getRandomDate2(str.getDate());
addEvent(new DefaultScheduleEvent("Bénéfices Net du jour = "+str.getNet()+"dinars",random1, random2));
}
}
};
}
public Date getRandomDate1(Date base) {
Calendar date = Calendar.getInstance();
date.setTime(base);
return date.getTime();
}
public Date getRandomDate2(Date base) {
Calendar date = Calendar.getInstance();
date.setTime(base);
date.add(Calendar.MINUTE, 10);
return date.getTime();
}
/////
public void onEventSelect(SelectEvent selectEvent)
{ ScheduleEvent event = (ScheduleEvent) selectEvent.getObject();
//event. = (ScheduleEvent) ((SelectEvent) lazyEventModel).getObject();
}
////
public ScheduleModel getLazyEventModel()
{
return lazyEventModel;
}
}
的問題是,這個代碼利用好工作與primefaces 3.3 JARS但是當我切換到Primefaces 4.0,沒有更多的顯示的事件的顏色和活動成爲一種透明的!這個代碼有什麼問題?
PS:str.getAjouteroulivr()是一個包含它包含「Ajout」或「Livraison」事件
這適用於我 – maxtorzito