[richfaces-issues] [JBoss JIRA] Resolved: (RF-2482) calendar bundle is not used if message-bundle is not set
Tsikhon Kuprevich (JIRA)
jira-events at lists.jboss.org
Tue Apr 8 11:50:55 EDT 2008
[ http://jira.jboss.com/jira/browse/RF-2482?page=all ]
Tsikhon Kuprevich resolved RF-2482.
-----------------------------------
Resolution: Done
Should be verified at 3.1.5
> calendar bundle is not used if message-bundle is not set
> --------------------------------------------------------
>
> Key: RF-2482
> URL: http://jira.jboss.com/jira/browse/RF-2482
> Project: RichFaces
> Issue Type: Bug
> Affects Versions: 3.1.4
> Reporter: Grigory Mischenko
> Assigned To: Mikhail Vitenkov
> Priority: Minor
> Fix For: 3.1.5, 3.2.0
>
>
> if message-bundle is not set in faces-config.xml, Calendar don't use org.richfaces.renderkit.calendar.
> The bug is in CalendarRendererBase.writeStringsFromBundle. CALENDAR_BUNDLE should be used if varibal "lable" is not null. At present code CALENDAR_BUNDLE is used if message bundle exists and it don't cantain lable.
> Wrong code:
> public void writeStringsFromBundle(ResourceBundle bundle1, ResourceBundle bundle2, String name,
> ResponseWriter writer) throws IOException {
>
> String label = null;
> try {
> if(null != bundle1){
> label = bundle1.getString("RICH_CALENDAR_" + name.toUpperCase() + "_LABEL");
> }
>
> } catch (MissingResourceException e) {
> // Current key wasn't found in application bundle, use CALENDAR_BUNDLE
> try {
>
> if(null != bundle2){
> label = bundle2.getString("RICH_CALENDAR_" + name.toUpperCase() + "_LABEL");
> }
> } catch (MissingResourceException exc) {
> // Current key wasn't found, use default, ignore this exception.
> }
> }
> writeStringFoundInBundle(name, label, writer);
>
> }
> Right code:
> public void writeStringsFromBundle(ResourceBundle bundle1, ResourceBundle bundle2, String name,
> ResponseWriter writer) throws IOException {
>
> String label = null;
> try {
> if(null != bundle1){
> label = bundle1.getString("RICH_CALENDAR_" + name.toUpperCase() + "_LABEL");
> }
>
> } catch (MissingResourceException e) {
> }
> if(null == label) {
> // Current key wasn't found in application bundle, use CALENDAR_BUNDLE
> try {
>
> if(null != bundle2){
> label = bundle2.getString("RICH_CALENDAR_" + name.toUpperCase() + "_LABEL");
> }
> } catch (MissingResourceException exc) {
> // Current key wasn't found, use default, ignore this exception.
> }
> }
> writeStringFoundInBundle(name, label, writer);
>
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the richfaces-issues
mailing list