ICEfaces
  1. ICEfaces
  2. ICE-5290

outputMessageRenderer should use ViewRoot locale

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2-EE-GA
    • Fix Version/s: 1.8.2-EE-GA_P01, 1.8.3
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      -

      Description

      Issue description from forum post:
      ----------------------------------------------

      There's a bug in RenderKit's OutputMessageRenderer (the renderer for ice:outputFormat): the used message formatter will not use the ViewRoot's locale (session locale), instead Locale.getDefault() will be used.

      -> So I've a problem if I want to show a RessourceBundle message like "{0} darf nicht früher sein als {1,date}" in the user's language and default (date) formats (e.g. for german: dd.MM.yyyy).

      I've fixed this by overwriting the OutputMessageRenderer:
      Code:

       ...
       // uiComponentValue = MessageFormat.format(uiComponentValue, parameters);
       MessageFormat mf = new MessageFormat(uiComponentValue, facesContext.getViewRoot().getLocale());
       uiComponentValue = mf.format(parameters);
       ...
       

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Tyler Johnson
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: