0 Replies Latest reply on May 7, 2014 6:55 PM by mdmaurer

    rich:calendar and locale/language

    mdmaurer

      I am using rich:calendar in my multi-lingual JSF app. Users can switch between English, French, German, Italian, and Dutch as the display language. The rich:calendar component is supposed to be locale aware, and I have the locale attribute set on it. When the locale changes in the current FacesContext, everything on the page changes to the new language/locale, including the popup calendar. But the display field portion of the rich:calendar (the text area that displays the selected date) does not. The date remains in the previous locale and then fails validation when the form is submitted. I have to manually pop up the calendar again and re-select the date in the new locale in order to get it to validate. This is unacceptable because some of the date fields contain default values, and they need to change to the new locale/language along with the rest of the page.

       

      Can anyone help with a workaround for this? How can I get the selected date to automatically change to the new selected locale/language without having to re-select it?

       

      I am using RichFaces 3.3.1

       

      JSF snippet:

      <rich:calendar value="#{ordersBean.startDate}" id="startDate"

                            locale="#{localeBean.locale}"

                            popup="true" datePattern="dd-MMM-yyyy"

                            showApplyButton="false" cellWidth="24px" cellHeight="22px" style="width:200px" />

       

      Java bean snippet:

      public class OrdersBean

      {

          private java.util.Date startDate;

       

          public java.util.Date getStartDate()

          {

              return startDate;

          }

       

       

          public void setStartDate( java.util.Date date)

          {

              startDate = date;

          }

      }