Skip to Main Content

Not able to set invalidDays (multiple dates)

937143May 25 2012
Hi All


I am try to disable the particular dates using following code But its not working .
how to set noumer of date list as invalid date?

Page code:

<tr:inputDate id='dt1' value="#{accountDateValidation.openDt}" autoSubmit="true"
<tr:validateDateRestriction invalidDays="#{drHolidayValidator}"/>
</tr:inputDate>
OR

<tr:inputDate id='dt1' value="#{accountDateValidation.openDt}" autoSubmit="true"
<tr:validateDateRestriction invalidDays="#{HolidayValidator.holidays }"/>
</tr:inputDate>

=======================
Backingbaean code

public class HolidayValidator implements DateListProvider,Serializable {


public List<Date> getDateList(FacesContext facesContext, Calendar calendar,
Date rangeStart, Date rangeEnd) {
List<Date> holidays = null;
try {
//Changed for Performance Tuning.
holidays = ApplicationValueHolder.getCurrentInstance().getListOfHolidays();
} catch (Exception ex) {
}
return holidays;
}
}

and i set HolidayValidator.holidays with perfect setter and getting methods but that aslo not working i got following error


Caused by: com.sun.facelets.tag.TagAttributeException: /pages/account/accoutpage.jspx @2934,78 invalidDays="#{HolidayValidator.holidays}" Cannot convert [Fri Dec 31 00:00:00 IST 2010, Mon Jan 17 00:00:00 IST 2011, Mon Feb 21 00:00:00 IST 2011, Mon May 30 00:00:00 IST 2011, Mon Jul 04 00:00:00 IST 2011, Mon Sep 05 00:00:00 IST 2011, Mon Oct 10 00:00:00 IST 2011, Fri Nov 11 00:00:00 IST 2011, Thu Nov 24 00:00:00 IST 2011, Mon Dec 26 00:00:00 IST 2011, Mon Jan 02 00:00:00 IST 2012, Mon Jan 16 00:00:00 IST 2012, Mon Feb 20 00:00:00 IST 2012, Mon May 28 00:00:00 IST 2012, Wed Jul 04 00:00:00 IST 2012, Mon Sep 03 00:00:00 IST 2012, Mon Oct 08 00:00:00 IST 2012, Mon Nov 12 00:00:00 IST 2012, Thu Nov 22 00:00:00 IST 2012, Tue Dec 25 00:00:00 IST 2012] of type class java.util.ArrayList to interface org.apache.myfaces.trinidad.model.DateListProvider
Post Details
Locked due to inactivity on Jun 22 2012
Added on May 25 2012
0 comments
431 views