-
1. Re: Setting holidays in the rich:calendar
ilya_shaikovsky Nov 14, 2007 8:01 AM (in response to manishsjain)you may use two approaches
in ajax mode or using preloads - you may provide - dataModel which should return classes for every day
Or you may use JS function which will return styleClass name to the day. In this case you'll be need to implement the function which will return this class for given date, but you'l' be also responsible for saving this state on server side if you need. -
2. Re: Setting holidays in the rich:calendar
tjakopec Nov 14, 2007 8:04 AM (in response to manishsjain)Yes, it would be nice to have some list off additional dates that are like sat/sun. attribute name will be highlitedDates and it will be a List. Somewhere in ours backing beans we set that list.
I now there is already boundaryDatesMode, but highlitedDates (holidayDates) should also be implemented! -
3. Re: Setting holidays in the rich:calendar
ilya_shaikovsky Nov 14, 2007 8:10 AM (in response to manishsjain)You could implement any styles/content/disablement using dataModel
-
4. Re: Setting holidays in the rich:calendar
manishsjain Nov 14, 2007 8:19 AM (in response to manishsjain)Thanks for quick response.
Any example or sample code snippet will be real helpful -
5. Re: Setting holidays in the rich:calendar
ilya_shaikovsky Nov 14, 2007 8:45 AM (in response to manishsjain)you may check it from developers samples. isntructions in wiki.
-
6. Re: Setting holidays in the rich:calendar
manishsjain Nov 15, 2007 3:14 AM (in response to manishsjain)Hi,
I have added following code
public CalendarDataModelItem[] getData(Date[] dateArray) {
if (dateArray == null) {
return null;
}
CalendarDataModelItem[] items = new CalendarDataModelItem[dateArray.length];
for (int i = 0; i < dateArray.length; i++) {
System.out.println("item is:"+ dateArray);
items = createDataModelItem(dateArray);
System.out.println("item is:"+ items.getStyleClass());
}
return items;
}
protected CalendarDataModelItem createDataModelItem(Date date) {
CalendarDataModelItemImpl item = new CalendarDataModelItemImpl();
System.out.println("the day is:"+date.getDay());
if(date.getDay() > 3)
item.setStyleClass("rich-calendar-weekends");
item.setData(date);
return item;
}
But on the screen i cannot see the particular date getting rendered as per the spcecified style class. If I see the source it shows the proper style class on dates but they are not rendered.
Am i missing something? Please help -
7. Re: Setting holidays in the rich:calendar
_jmax_ Nov 20, 2007 9:40 AM (in response to manishsjain)I would like to set a style class for holidays.
Is it possible to see code snippets with the 2 approaches:you may use two approaches
in ajax mode or using preloads - you may provide - dataModel which should return classes for every day
Or you may use JS function which will return styleClass name to the day. In this case you'll be need to implement the function which will return this class for given date, but you'l' be also responsible for saving this state on server side if you need.
Thanks -
8. Re: Setting holidays in the rich:calendar
manishsjain Dec 5, 2007 3:37 AM (in response to manishsjain)I tried both the alternates suggested but it seems not to work. Whenever i set the syle class for any particular date it sets for all the days in that month
[img][/img] -
9. Re: Setting holidays in the rich:calendar
manishsjain Dec 6, 2007 11:26 PM (in response to manishsjain)Can any body from developer community help on this? This is becoming really problemetic for the project work.