-
1. Re: How to change rich:calandar bottom name?
bkersten Jul 21, 2010 5:32 AM (in response to eswaramoorthy1985)1 of 1 people found this helpfulAFAIK 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
-
2. Re: How to change rich:calandar bottom name?
eswaramoorthy1985 Jul 21, 2010 5:59 AM (in response to bkersten) -
3. Re: How to change rich:calandar bottom name?
ilya_shaikovsky Jul 21, 2010 6:44 AM (in response to eswaramoorthy1985)1 of 1 people found this helpfulNo 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. -
4. Re: How to change rich:calandar bottom name?
eswaramoorthy1985 Jul 23, 2010 5:47 AM (in response to ilya_shaikovsky)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>