2 Replies Latest reply on Apr 7, 2008 11:17 PM by William Woodman

    problem with seam validator on dates

    William Woodman Master

      I cant get the seam convertDateTime to work.

      I have a simple form control declared as follows

                 <s:decorate id="dateOfBirthDecoration" template="layout/edit.xhtml">
                      <ui:define name="label">Date Of Birth</ui:define>
                      <h:inputText id="dateOfBirth" 
                              <s:convertDateTime  type="date" dateStyle="medium"  pattern="dd/mm/yyyy" />

      in the backing entity I have a definition as follows

           public GregorianCalendar getDateOfBirth()
                return dateOfBirth;
           public void setDateOfBirth(GregorianCalendar dateOfBirth)
                this.dateOfBirth = dateOfBirth;

      when i fill in a date line

      20\10\1962  i get a seam validation faiure like this

      person.xhtml @55,60 value="#{person.dateOfBirth}": java.lang.IllegalArgumentException: argument type mismatch

      Bit unclear from the seam documentation as to what this should look like - however i think i had it right - but clearly not. 

      how do i get the format to accept the DD\MM\YYYY input format ?