2 Replies Latest reply on Oct 18, 2012 9:35 AM by cbrueckner

    rich:calendar defaultlabel text causing page validation error

    cbrueckner

      I'm using the calendar for an optional date input on the form.  When "defaultLabel" is set and the user leaves the field blank, validation fails telling me the string provided by defaultLabel is not a valid date.  If I remove "defaultLabel" the form will validate with the blank date field.

       

      <rich:calendar id="optionalDate" value="#{someMgmntBean.optionalDate}" datePattern="M/d/yyyy" enableManualInput="true" defaultLabel="MM/dd/yyyy"/>

       

      validation failure message:

      someForm:optionalDate: 'MM/dd/yyyy' could not be understood as a date. Example: 10/17/2012

        • 1. Re: rich:calendar defaultlabel text causing page validation error
          sivaprasad9394

          Hi Chris,

           

          In <rich:calender there is no attribute like "defaultLabel".check it.only label is available as attribute for calender.

           

           

          Thanks,

          Siva

          • 2. Re: rich:calendar defaultlabel text causing page validation error
            cbrueckner

            Siva,

             

            It does appear to exist in 4.1.0.Final (also checked 4.3.0.20120802-M1).

             

            rich.taglib.xml

                <tag>
                    <tag-name>calendar</tag-name>
                    <component>
                        <description>@author amarkhel</description>
                        <component-type>org.richfaces.Calendar</component-type>
                        <renderer-type>org.richfaces.CalendarRenderer</renderer-type>
                        <handler-class>org.richfaces.view.facelets.CalendarHandler</handler-class>
                    </component>

            ...

                    <attribute>
                        <name>defaultLabel</name>
                        <type>java.lang.String</type>
                    </attribute>

             

            Chris