jsf - How disable past and future dates in <p:calendar>? -


i need disable past dates current date , make available 3 upcoming dates current day in <p:calendar> component primefaces. how this?

you can use mindate , maxdate attributes of <p:calendar> component. example:

<p:calendar mindate="#{datebean.today}" maxdate="#{datebean.todayplusthree}" /> 

in datebean bean, you'd have (at least) 2 getters content similar this:

public date gettoday() {    calendar c = calendar.getinstance();     return c.gettime(); }  public date gettodayplusthree() {    calendar c = calendar.getinstance();     c.add(calendar.date, 3);    return c.gettime(); } 

Comments

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -