ICEfaces
  1. ICEfaces
  2. ICE-9143

dateTimeEntry 3.x jQuery version populate javascript localisation from server DateFormatSymbols

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 4.0.BETA, 4.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ACE 3.x
    • Assignee Priority:
      P2
    • Workaround Exists:
      Yes
    • Workaround Description:
      In the application, take the DateFormatSymbols and populate your .xhtml file with the javascript localisation strings manually for each locale that you support.

      Description

      When our dateTimeEntry component was YUI based and more rendered from the server, we had the ability to support any localisation that Java supports, automatically, as of ICE-6081. Since transitioning to basing dateTimeEntry off of jQuery, with it's rendering being done client side in javascript, we've used a model where the localisation is up to the application, as demonstrated in dateTimeEntry-locale-tutorial.

      It would be good to provide a means to hook into the faces-config.xml supported-locale and default-locale entries, and provide a means of populating the javascript locale structures based off of the Java server DateFormatSymbols.

      One necessity is that f:convertDateTime will take the client provided date string and pass it to a DateTimeConverter, which will use all of the Java in-built localisation strings, and cause conversion errors if the given string doesn't match the in-built strings. So it makes sense to make it use what it expects, and not encourage arbitrary strings from applications.
      1. dateTimeEntry-locale-FF21.png
        84 kB
      2. screenshot-01.png
        272 kB
      3. screenshot-02.png
        248 kB
      4. screenshot-03.png
        245 kB
      5. screenshot-04.png
        247 kB
      6. screenshot-05.png
        234 kB

        Activity

        Hide
        yip.ng added a comment -

        Done. See screenshot-01.png, screenshot-02.png, screenshot-03.png.

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\datetimeentry\datetimeentry.js#36979
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java#36979

        Show
        yip.ng added a comment - Done. See screenshot-01.png , screenshot-02.png , screenshot-03.png . M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\datetimeentry\datetimeentry.js#36979 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java#36979
        Hide
        Carmen Cristurean added a comment - - edited

        Reopening this because of the dateTimeEntry-locale tutorial styling issues found in all browsers (icefaces3/trunk rev# 36985), see attached screen shot.

        Show
        Carmen Cristurean added a comment - - edited Reopening this because of the dateTimeEntry-locale tutorial styling issues found in all browsers (icefaces3/trunk rev# 36985), see attached screen shot.
        Hide
        yip.ng added a comment - - edited

        jQuery datepicker has two short weekday names: dayNamesShort for formatting, dayNamesMin for column headers. Java doesn't have equivalent of dayNamesMin, therefore Java short names are used for both. The wider column headers may disturb calendar layout in some locales and/or page layouts.

        Turorial's JS setting for dayNamesMin overriden by Java short names. Should we not override? Then user has to always set dayNamesMin by JS.

        Show
        yip.ng added a comment - - edited jQuery datepicker has two short weekday names: dayNamesShort for formatting, dayNamesMin for column headers. Java doesn't have equivalent of dayNamesMin, therefore Java short names are used for both. The wider column headers may disturb calendar layout in some locales and/or page layouts. Turorial's JS setting for dayNamesMin overriden by Java short names. Should we not override? Then user has to always set dayNamesMin by JS.
        Hide
        Mark Collette added a comment -

        It looks like we're hard-coding sizing for the calendar, when it should take up whatever space is necessary. There's no way we can predict the required sizing before-hand, given both horizontal and vertical text, of varying lengths.

        Show
        Mark Collette added a comment - It looks like we're hard-coding sizing for the calendar, when it should take up whatever space is necessary. There's no way we can predict the required sizing before-hand, given both horizontal and vertical text, of varying lengths.
        Hide
        Ken Fyten added a comment -

        Nils to prototype some structural styling changes to have the calendar cols all size to the width of the widest column.

        Show
        Ken Fyten added a comment - Nils to prototype some structural styling changes to have the calendar cols all size to the width of the widest column.
        Hide
        Nils Lundquist added a comment - - edited

        Removing the fixed em width from .ui-datepicker-calendar will resolve the overflow issue. We're unconcerned with unequal column sizes.

        In the case that some client wants equal col widths in the future- we'll need to modify the init script to propagate the largest column width to all other columns.

        Show
        Nils Lundquist added a comment - - edited Removing the fixed em width from .ui-datepicker-calendar will resolve the overflow issue. We're unconcerned with unequal column sizes. In the case that some client wants equal col widths in the future- we'll need to modify the init script to propagate the largest column width to all other columns.
        Hide
        yip.ng added a comment - - edited
        1. Fixed 17em width removed as suggested above.
        2. Attribute added to control override for backwards compatibility (as brought up by Mark). screenshot-04.png.
        3. Showcase demo done. screenshot-05.png.

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\datetimeentry\datetimeentry.js#37048
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryMeta.java#37048
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java#37048
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\jquery\ui\jquery-ui.css#37048

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\java\org\icefaces\samples\showcase\example\ace\date\DateEntryBean.java#37049
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\webapp\resources\examples\ace\date\datelocale.xhtml#37049
        A: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\java\org\icefaces\samples\showcase\example\ace\date\DateLocaleBean.java#37049
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\resources\org\icefaces\samples\showcase\view\resources\messages.properties#37049

        Show
        yip.ng added a comment - - edited Fixed 17em width removed as suggested above. Attribute added to control override for backwards compatibility (as brought up by Mark). screenshot-04.png . Showcase demo done. screenshot-05.png . M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\datetimeentry\datetimeentry.js#37048 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryMeta.java#37048 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java#37048 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\jquery\ui\jquery-ui.css#37048 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\java\org\icefaces\samples\showcase\example\ace\date\DateEntryBean.java#37049 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\webapp\resources\examples\ace\date\datelocale.xhtml#37049 A: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\java\org\icefaces\samples\showcase\example\ace\date\DateLocaleBean.java#37049 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\resources\org\icefaces\samples\showcase\view\resources\messages.properties#37049
        Hide
        Ken Fyten added a comment -

        Let's remove the new attribute altogether, and document the component localization precedence as any defined JS overrides the normally used server-provided localization, which is what occurs if you don't use the attribute anyway.

        Show
        Ken Fyten added a comment - Let's remove the new attribute altogether, and document the component localization precedence as any defined JS overrides the normally used server-provided localization, which is what occurs if you don't use the attribute anyway.
        Hide
        yip.ng added a comment -

        Done.

        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\webapp\resources\examples\ace\date\datelocale.xhtml#37062
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\datetimeentry\datetimeentry.js#37062
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryMeta.java#37062
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java#37062
        M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\resources\org\icefaces\samples\showcase\view\resources\messages.properties#37062

        Show
        yip.ng added a comment - Done. M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\webapp\resources\examples\ace\date\datelocale.xhtml#37062 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\resources\icefaces.ace\datetimeentry\datetimeentry.js#37062 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryMeta.java#37062 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\ace\component\src\org\icefaces\ace\component\datetimeentry\DateTimeEntryRenderer.java#37062 M: C:\svn\ossrepo\icefaces3\trunk\icefaces\samples\showcase\showcase\src\main\resources\org\icefaces\samples\showcase\view\resources\messages.properties#37062

          People

          • Assignee:
            yip.ng
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: