4 Replies Latest reply on Jul 23, 2010 5:47 AM by eswaramoorthy1985

    How to change rich:calandar bottom name?

    eswaramoorthy1985

      Hi,

       

            i want to change the label Delete instaead of Clean.

       

      For example , If i choose any date(July 21) in rich:calendar. And then after i click the calandar componet, it show the calandar.

       

      It show the current month details and ,

       

      bottom have following details : currently selected date like July 21 2010,  Clean ,  Today.

       

      I want to change the label Delete instead of clean.

       

       

      <rich:calendar id="richCalendarId" cellWidth="24px"  cellHeight="22px"/>
      

       

      Find the my attachment RichCaladar.png, and see the label clean. Give me idea about to change that clean label.

       

      Help me.

      Thanks in advance.

        • 1. Re: How to change rich:calandar bottom name?
          bkersten

          AFAIK these labels are hard coded in calendar.js so that there is no option to set this value directly by means of an attribute or resource-file. Anyone plz correct me if I'm wrong.

          Therefore, I suggest to overwrite the value via Javascript. Sample snippet to add to your page:

           

          <script type="text/javascript">
            document.observe('dom:loaded', function() {
              var cal = $('calendarClientId').component;
              cal.params.labels = {apply:'Apply', today:'Today', clean:'Delete', ok:'OK', cancel:'Cancel', close:'x'};
              cal.calendarContext.controlLabels = {apply:'Apply', today:'Today', clean:'Delete', ok:'OK', cancel:'Cancel', close:'x'};
            });
          </script>
          

           

          where calendarClientId has to be replaced with your clientId of the calendar, e.g. s.th. like 'yourFormId:richCalendarId'

          clean:'Delete' is the point...

           

          Regards

          Benjamin

          1 of 1 people found this helpful
          • 2. Re: How to change rich:calandar bottom name?
            eswaramoorthy1985

            Thanks Benjamin Kersten,

             

            Its really help for me.

            • 3. Re: How to change rich:calandar bottom name?
              ilya_shaikovsky

              No them are not hardcoded.

              Check

              http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_calendar.html

               

              The <rich:calendar> component provides the possibility to use internationalization method to redefine and localize the labels. You could use application resource bundle and define RICH_CALENDAR_APPLY_LABEL, RICH_CALENDAR_TODAY_LABEL, RICH_CALENDAR_CLOSE_LABEL, RICH_CALENDAR_OK_LABEL,RICH_CALENDAR_CLEAN_LABEL, RICH_CALENDAR_CANCEL_LABEL there.

              You could also pack org.richfaces.renderkit.calendar resource bundle with your JARs defining the same properties.

              1 of 1 people found this helpful
              • 4. Re: How to change rich:calandar bottom name?
                eswaramoorthy1985

                Thanks Ilya Shaikovsky,

                 

                I got the solution using application resource bundle.

                 

                resources.properties

                RICH_CALENDAR_CLEAN_LABEL=Clear

                 

                my faces-config.xml file

                                                      <faces-config>

                                                                 <application>
                                                                                     <message-bundle>resources</message-bundle>
                                                                 </application>
                                                                 ...
                                                                 ... 
                                                     </faces-config>