5 Replies Latest reply on Aug 6, 2008 2:36 PM by nohacks

    rich:calendar

      Hey Guys,

      I am using rich:calendar and need to set the default year.

      How do I set that year?

      <rich:calendar value="#{TestFormBean.memberDOB_Date}"
       id="memberDOB"
       required="true"
       locale="#{calendarBean.locale}"
       popup="#{calendarBean.popup}"
       datePattern="#{calendarBean.pattern}"
       showApplyButton="#{calendarBean.showApply}"/>
      



      This is the bean..
      
       private Date memberDOB_Date ;
      
       public Date getMemberDOB_Date() {
       return memberDOB_Date;
       }
       public void setMemberDOB_Date(Date memberDOB_Date) {
       this.memberDOB_Date = memberDOB_Date;
       }
      
      







        • 1. Re: rich:calendar

          Ok...I have a default date...

          private Date memberDOB_Date =
           new Date(System.currentTimeMillis() - 1000L * 60 * 60 * 24 * 30);
          


          anyone know how to require a minimum date range ??



          • 2. Re: rich:calendar

            Any Help out there ???

            • 3. Re: rich:calendar
              ilya_shaikovsky

              to set default year (not selected date) use currentDate attribute.

              "anyone know how to require a minimum date range ??" Not sure that understand you.

              • 4. Re: rich:calendar

                Thanks for your response...

                I do set the default date... with this..

                 private Date memberDOB_Date =
                 new Date(System.currentTimeMillis() - 1000L * 60 * 60 * 24 * 9000);


                where 9000 is the days minus the current date...

                I was wondering how I enforce the DOB date being a min of 18 years old..

                I can do this with javaScript and Onclick before the submit. I wondered if there was a field level validator with ajax or the cal function ??

                Thanks
                Phil


                • 5. Re: rich:calendar

                  any help on doing this without javaScript and Onclick before the submit.

                  Phil