5 Replies Latest reply on Apr 27, 2010 7:56 AM by lgweb

    Rich:Calendar problem

    lgweb

      hello staff have to do two customizations in a rich: calendar, one of them and take weeks to count that appears on the right side of the calendar and another and display only the days belonging to the current month displayed in the calendar.
      Anyone know how to do this?
      Thanks

        • 1. Re: Rich:Calendar problem
          lgweb

          displaying the count of weeks I could hide using showWeeksBar = "false" but I tried to use the attribute boundaryDatesMode to display only the days belonging to the month displayed in the calendar, but no, any ideas guys?

          Thank you.

          • 2. Re: Rich:Calendar problem
            ilya_shaikovsky

            boundaryDatesMode="none" should works for you.

            • 3. Re: Rich:Calendar problem
              lgweb

              Ilya Thanks for the reply, but still appearing naum worked the days of months later and earlier disabled in the calendar I'm using the version-RichFaces impl-3.3.2.SR1.jar
              In any other way to solve this?
              Thanks

               

               

              see my code:

              <rich:calendar value="#{mBRelatorio.dataInicial}"
                                      locale="pt_BR" popup="true" inputStyle="width:100px"
                                      datePattern="dd/MMM/yyyy" required="true"
                                      requiredMessage="Campo data inicial é de preenchimento obrigatório!"
                                      showApplyButton="false" enableManualInput="true"
                                      style="width:138;"  showWeeksBar="false"
                                      boundaryDatesMode="none" />

              • 4. Re: Rich:Calendar problem
                ilya_shaikovsky

                https://jira.jboss.org/jira/browse/RF-8622 sorry. I was sure that we have dealt with that request a long agon and even not checked. Now it seems for me that we found workaround and does nothing in the passt. So I created task to cover in 4.x.

                 

                The first workaround is:

                 

                .rich-calendar-boundary-dates  {
                color:transparent;
                
                
                }
                

                 

                but the dates will still be there and visible on text selection .

                 

                 

                <script>
                 function returnDay(month,day)
                {
                if (month==0) return day; else return '';
                }
                </script>
                <h:panelGrid id="panel" columns="2" columnClasses="ecol1, ecol2">
                <a4j:outputPanel id="calendar" layout="block">
                <rich:calendar value="#{calendarBean.selectedDate}"
                locale="#{calendarBean.locale}" showWeeksBar="false"
                popup="#{calendarBean.popup}"
                datePattern="#{calendarBean.pattern}"
                showApplyButton="#{calendarBean.showApply}" cellWidth="24px" cellHeight="22px" style="width:200px">
                {returnDay(_month, day)}
                </rich:calendar>
                </a4j:outputPanel>
                

                 

                in this case dates will be hidden properly - them will just not be present in markup. But in the case of markup redefinition - calendar not alligning dates content in cell and you're responsible for that on your own.

                • 5. Re: Rich:Calendar problem
                  lgweb
                  <script>
                  function returnDay(month,day)
                  {
                  if (month==0) return day; else return '';
                  }
                  </script>
                  <h:panelGrid id="panel" columns="2" columnClasses="ecol1, ecol2">
                  <a4j:outputPanel id="calendar" layout="block">
                  <rich:calendar value="#{calendarBean.selectedDate}"
                  locale="#{calendarBean.locale}" showWeeksBar="false"
                  popup="#{calendarBean.popup}"
                  datePattern="#{calendarBean.pattern}"
                  showApplyButton="#{calendarBean.showApply}" cellWidth="24px" cellHeight="22px" style="width:200px">
                  {returnDay(_month, day)}
                  </rich:calendar>
                  </a4j:outputPanel>

                   

                   

                  Ilya worked perfectly, problem solved,
                  once again thanks