ICEfaces
  1. ICEfaces
  2. ICE-2176

selectInputDate should expose title attribute

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7DR#1
    • Fix Version/s: 1.7DR#3, 1.7
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Win XP SP2, Firefox 2.0.0.6
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Even if you use a DateTimeConverter, just redundantly define the popupDateFormat attribute, so that title will be derived from it.
      Show
      Even if you use a DateTimeConverter, just redundantly define the popupDateFormat attribute, so that title will be derived from it.

      Description

      Before ICE-2150, we used the popupDateFormat attribute to define the DateFormat object for selectInputDate's input text field, which allowed us to use that attribute for the rendered title attribute as well. Since switching to using the DateTimeConverter, there isn't a way of guaranteeing that we can deduce the date format string from the DateTimeConverter, since it doesn't actually expose its DateFormat object, which can be defined from a combination of several attributes, or simply be overridden in a subclass to behave completely differently.

      And there's also some user interface and localisation issues, such as how there's a hard-coded English string ("Date Format: ") used in the tooltip, and how the Java style date format string might not actually make sense to a user. They might wonder why "yyyy/MM/dd" has the month capitalised, for example.

      So we're going to go with making title a pass-through attribute, that the user can define themself. For backwards compatibility, we'll use this level of precedence:

      1. If the title attribute is given, use it

      2. If the title attribute is not given, and popupDateFormat is, then we'll set the rendered attribute to the old "Date Format: " + selectInputDate.getPopupDateFormat().

      3. If neither is given, then don't specify the title attribute, so that we're not potentially misinforming the user.

        Issue Links

          Activity

          Hide
          Mark Collette added a comment -

          Because of ICE-2424, instead of step #2 being:

          2. If the title attribute is not given, and popupDateFormat is, then we'll set the title attribute to the old "Date Format: " + selectInputDate.getPopupDateFormat().

          Instead it will now be:

          2. If the title attribute is not given, and popupDateFormat is, then we'll set the title attribute to the MessageFormat whose pattern is given in icefaces\component\src\com\icesoft\faces\resources\messages.properties by the com.icesoft.faces.component.selectinputdate.INPUT_TEXT_TITLE key, which uses selectInputDate.getSpecifiedPopupDateFormat() as the parameter.

          Show
          Mark Collette added a comment - Because of ICE-2424 , instead of step #2 being: 2. If the title attribute is not given, and popupDateFormat is, then we'll set the title attribute to the old "Date Format: " + selectInputDate.getPopupDateFormat(). Instead it will now be: 2. If the title attribute is not given, and popupDateFormat is, then we'll set the title attribute to the MessageFormat whose pattern is given in icefaces\component\src\com\icesoft\faces\resources\messages.properties by the com.icesoft.faces.component.selectinputdate.INPUT_TEXT_TITLE key, which uses selectInputDate.getSpecifiedPopupDateFormat() as the parameter.
          Hide
          Mark Collette added a comment -

          It now follows the rules of precedence described above. Added the metadata for this attribute, since it was already supported in a superclass.

          Subversion 15236
          icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-selectInputDate-props.xml
          icefaces\component\src\com\icesoft\faces\component\selectinputdate\SelectInputDateRenderer.java

          Added some more explanation, in the TLD doc for popupDateFormat, about it's relationship with the title attribute.

          Subversion 15239
          icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-selectInputDate-props.xml

          Changed the component-showcase to use the title attribute, as well as removed the deprecated imageDir usage there.

          Subversion 15262
          icefaces\samples\component-showcase\src\com\icesoft\icefaces\samples\showcase\resources\messages.properties
          icefaces\samples\component-showcase\web\inc\components\selectInputDate.jspx

          Show
          Mark Collette added a comment - It now follows the rules of precedence described above. Added the metadata for this attribute, since it was already supported in a superclass. Subversion 15236 icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-selectInputDate-props.xml icefaces\component\src\com\icesoft\faces\component\selectinputdate\SelectInputDateRenderer.java Added some more explanation, in the TLD doc for popupDateFormat, about it's relationship with the title attribute. Subversion 15239 icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-selectInputDate-props.xml Changed the component-showcase to use the title attribute, as well as removed the deprecated imageDir usage there. Subversion 15262 icefaces\samples\component-showcase\src\com\icesoft\icefaces\samples\showcase\resources\messages.properties icefaces\samples\component-showcase\web\inc\components\selectInputDate.jspx

            People

            • Assignee:
              Unassigned
              Reporter:
              Mark Collette
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: