MyFaces Trinidad
  1. MyFaces Trinidad
  2. TRINIDAD-797

Date-picker does not use the converter's locale attribute if it differs from page locale

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.5-core
    • Component/s: Components
    • Labels:
      None

      Description

      1. Suppose the page locale is en_us. Add an inputDate to the jspx with a converter of a different locale, e.g.
      <tr:inputDate id="mdf6" value="#

      {date.date4}

      "
      label="attached converter">
      <tr:convertDateTime type="date" dateStyle="full" locale="fr_FR"/>
      </tr:inputDate>

      2. Run the page - the inputDate shows up with the text in french, as expected.
      3. Open the picker, and pick a different date.
      4. When the picker closes, the inputDate has been updated with the Date in English.

      1. Trinidad11_797.patch
        18 kB
        Yee-Wah Lee
      2. trin11_797_deferredRenderers.patch
        4 kB
        Yee-Wah Lee
      3. trin12_797_deferredRenderers.patch
        4 kB
        Yee-Wah Lee

        Issue Links

          Activity

          Yee-Wah Lee created issue -
          Hide
          Yee-Wah Lee added a comment -

          1. The client DateTimeConverter makes use of the LocaleElements_<locale>.js file, but only the locale elements for the page are sent down. Hence, the client converter's attempt to convert the Date into a String uses the wrong locale data.

          2 . Possibly because of this, the server code which generates the client DateTimeConverter turns off client conversion, see trinidad-internal\..\DateTimeConverter#getClientConversion() which returns null.

          Show
          Yee-Wah Lee added a comment - 1. The client DateTimeConverter makes use of the LocaleElements_<locale>.js file, but only the locale elements for the page are sent down. Hence, the client converter's attempt to convert the Date into a String uses the wrong locale data. 2 . Possibly because of this, the server code which generates the client DateTimeConverter turns off client conversion, see trinidad-internal\..\DateTimeConverter#getClientConversion() which returns null.
          Hide
          Yee-Wah Lee added a comment -

          Patch which:
          1. Creates a scriptlet which loads a specified (named) locale.
          2. Calls DateTimeConverter to load the scriptlet when a non-page locale is requested.
          3. Adds examples of #2 in inputDate.jspx

          Show
          Yee-Wah Lee added a comment - Patch which: 1. Creates a scriptlet which loads a specified (named) locale. 2. Calls DateTimeConverter to load the scriptlet when a non-page locale is requested. 3. Adds examples of #2 in inputDate.jspx
          Yee-Wah Lee made changes -
          Field Original Value New Value
          Attachment Trinidad11_797.patch [ 12369552 ]
          Hide
          Gabrielle Crawford added a comment -

          patch applied in revision: 595495

          Show
          Gabrielle Crawford added a comment - patch applied in revision: 595495
          Gabrielle Crawford made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Fix Version/s 1.0.5-core [ 12312858 ]
          Hide
          Yee-Wah Lee added a comment -

          Additional patch to allow renderer extensions from a different render kit. The earlier code relied on the scriptlets being registered when the RenderingContext is available (during the render phase) but that behavior is not guaranteed outside the Trinidad renderkit which implements deferred renderer loading.

          Show
          Yee-Wah Lee added a comment - Additional patch to allow renderer extensions from a different render kit. The earlier code relied on the scriptlets being registered when the RenderingContext is available (during the render phase) but that behavior is not guaranteed outside the Trinidad renderkit which implements deferred renderer loading.
          Yee-Wah Lee made changes -
          Attachment trin11_797_deferredRenderers.patch [ 12375620 ]
          Yee-Wah Lee made changes -
          Attachment trin12_797_deferredRenderers.patch [ 12385461 ]
          Hide
          Yee-Wah Lee added a comment -

          Please see TRINIDAD-1258 for an amendment to this fix (in how the locale parameter is added)

          Show
          Yee-Wah Lee added a comment - Please see TRINIDAD-1258 for an amendment to this fix (in how the locale parameter is added)
          Matthias Weßendorf made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Manuel Blechschmidt made changes -
          Link This issue is duplicated by TRINIDAD-1960 [ TRINIDAD-1960 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Yee-Wah Lee
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development