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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

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

c# - Search and Add Comment with OpenXML for Word -