4 Replies Latest reply on Aug 9, 2010 12:56 PM by vinay bn

    Rich Calendar Past value submit Issue

    vinay bn Newbie

      I am facing strange problem with rich:calendar component.we are validating if past date is selected and throwing an error message.After that if we select future/current date ,the date converter is not getting called and also it is retaining the past value,goes through the validation and throws the error message again which should not happen.

       

      I used jave script to get the selected date.There iam getting the correct value whatever is selected(past/future) even after getting the error.

       

      Please let me know reason for this problem and also suggest any other solution apart from java script.

       

      Sample code snippet used in application:

       

      <a:richCalendar  id="startCal" value="#{pageBean.startTime}"  direction="top-right"  converter="DateConverter" datePattern="#{pageBean.calendarDateFormat}"
      popup="true" showApplyButton="true" enableManualInput="true">
      </a:richCalendar>

       

      Thanks and Regards

      Vinay BN

        • 1. Re: Rich Calendar Past value submit Issue
          Ilya Shaikovsky Master

          show more complete code please. In general such case was checkded an  should works.

          • 2. Re: Rich Calendar Past value submit Issue
            vinay bn Newbie

            <h:richDataTable rowKeyVar="rkv" rows="#{pageBean.noOfRows}"
              id="cn" rendered="#{pageBean.slist}"
              value="#{pageBean.cnList}" var="data"
              binding="#{pageBean.scNTable}">
              <h:richColumn>
               <f:facet name="header">
                <h:jsfOutputLabel value="Time" />
               </f:facet>
               <h:richCalendar id="cal_value" value="#{data.time}" direction="top-right"
                rendered="#{pageBean.renderEditableTime}"
                converter="DateConverter"
                datePattern="#{pageBean.calendarDateFormat}"
                popup="true" showApplyButton="true" enableManualInput="true">
               </a:richCalendar>
               <h:jsfOutputText value="#{data.time}" converter="DateConverter"
                rendered="#{!pageBean.renderEditableTime}" />
              </h:richColumn>

              <h:richColumn style="width:100%">
               <f:facet name="header">
                <h:jsfOutputLabel value="Message" />
               </f:facet>
               <h:jsfInputTextArea rows="4" cols="40" value="#{data.cMessage}"
                rendered="#{pageBean.renderEditableTime}" />
               <h:jsfOutputText value="#{data.customMessage}"
                rendered="#{!pageBean.renderEditableTime}" />
              </h:richColumn>

            </h:richDataTable>

             

             

            We are using rich calendar inside richDataTable as shown in sample code above.

            Once the user selects date and enters message,validating for mandatory fields.

            If either message/date is not entered,throwing a error panel.

            If selected date is past value,then also throwing a error panel.

             

            1. Once we get error panel on enetering past date,even if we enter future date after that,it will not pick that date,still holds the old value and valdiation fails.

            2. suppose if we clear the date field also,still it holds the past value and validation error is thrown for past date instead of mandatory field.

            • 3. Re: Rich Calendar Past value submit Issue
              Ilya Shaikovsky Master
              1 of 1 people found this helpful
              • 4. Re: Rich Calendar Past value submit Issue
                vinay bn Newbie

                Thank you very much Ilya. It's a very useful link and got the answer for my question.Thanks once again.