MyFaces Trinidad
  1. MyFaces Trinidad
  2. TRINIDAD-1036

Client Color Converter's getFormatHint() and DateRestrictionValidator return empty string for hints.

    Details

      Description

      1. Sample code to create a button which, when clicked, gets the format hint for a color field and displays it in an output text.

      <f:verbatim>
      <script language="javascript">
      function getHint ()

      { var colorField = document.getElementById ("sic1"); var format = _getColorFieldFormat (colorField); var colorHint = document.getElementById ("help_sic1"); colorHint.textContent = format.getFormatHint (); }

      </script>
      </f:verbatim>

      <tr:inputColor id="sic1" chooseId="cp1"
      label="Enter or select color from palette below">
      <f:facet name="help">
      <tr:outputText id="help_sic1" value="Format hint goes here if button is clicked"/>
      </f:facet>
      </tr:inputColor>
      <tr:commandButton onclick="getHint(this); return false;" text="Click for color hint"/>

      2. Run the page and click the button - the output text is updated with the string "Example Format: ". It should instead reflect the patterns for the inputColor which are defaulted in the example above, i.e. "Example Format: RRGGBB, #RRGGBB, r,g,b"

      Here is another example using the DateRestrictionValidator
      1. Go to this page, and look for the demo "Please no Mondays...!"
      http://www.irian.at/trinidad-demo/faces/convertValidate/dateRestrictionValidate.jspx

      2. Pick a Monday and submit, get the following error:
      Enter a date from the following weekday(s): .

      It should be an array of days that are permissible.
      2.

        Activity

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

        I think this used to be work before the changes in TRINIDAD-829 and TRINIDAD-873.

        Between these two changes, the method TrFastMessageFormatUtils.format() now works with strings whereas the color converter uses an Array of strings , e.g. "RRGGBB", "#RRGGBB", "r,g,b".

        Show
        Yee-Wah Lee added a comment - I think this used to be work before the changes in TRINIDAD-829 and TRINIDAD-873 . Between these two changes, the method TrFastMessageFormatUtils.format() now works with strings whereas the color converter uses an Array of strings , e.g. "RRGGBB", "#RRGGBB", "r,g,b" .
        Hide
        Yee-Wah Lee added a comment -

        Trunk attachment:

        • Changes _formatErrorMsg to call (String).replace only when typepof check passes.
        Show
        Yee-Wah Lee added a comment - Trunk attachment: Changes _formatErrorMsg to call (String).replace only when typepof check passes.
        Yee-Wah Lee made changes -
        Field Original Value New Value
        Attachment trin11_1036.diff [ 12379433 ]
        Hide
        Yee-Wah Lee added a comment -

        Attachment works for both trunk and jsf 1.2.6 branch.

        Show
        Yee-Wah Lee added a comment - Attachment works for both trunk and jsf 1.2.6 branch.
        Yee-Wah Lee made changes -
        Summary Client Color Converter's getFormatHint() returns empty string for the hints. Client Color Converter's getFormatHint() and DateRestrictionValidator return empty string for hints.
        Description 1. Sample code to create a button which, when clicked, gets the format hint for a color field and displays it in an output text.

                    <f:verbatim>
                      <script language="javascript">
                      function getHint ()
                      {
                        var colorField = document.getElementById ("sic1");
                        var format = _getColorFieldFormat (colorField);
                        var colorHint = document.getElementById ("help_sic1");
                        colorHint.textContent = format.getFormatHint ();
                      }
                      </script>
                    </f:verbatim>

              <tr:inputColor id="sic1" chooseId="cp1"
                                 label="Enter or select color from palette below">
                    <f:facet name="help">
                      <tr:outputText id="help_sic1" value="Format hint goes here if button is clicked"/>
                    </f:facet>
                  </tr:inputColor>
                  <tr:commandButton onclick="getHint(this); return false;" text="Click for color hint"/>

        2. Run the page and click the button - the output text is updated with the string "Example Format: ". It should instead reflect the patterns for the inputColor which are defaulted in the example above, i.e. "Example Format: RRGGBB, #RRGGBB, r,g,b"
        1. Sample code to create a button which, when clicked, gets the format hint for a color field and displays it in an output text.

                    <f:verbatim>
                      <script language="javascript">
                      function getHint ()
                      {
                        var colorField = document.getElementById ("sic1");
                        var format = _getColorFieldFormat (colorField);
                        var colorHint = document.getElementById ("help_sic1");
                        colorHint.textContent = format.getFormatHint ();
                      }
                      </script>
                    </f:verbatim>

              <tr:inputColor id="sic1" chooseId="cp1"
                                 label="Enter or select color from palette below">
                    <f:facet name="help">
                      <tr:outputText id="help_sic1" value="Format hint goes here if button is clicked"/>
                    </f:facet>
                  </tr:inputColor>
                  <tr:commandButton onclick="getHint(this); return false;" text="Click for color hint"/>

        2. Run the page and click the button - the output text is updated with the string "Example Format: ". It should instead reflect the patterns for the inputColor which are defaulted in the example above, i.e. "Example Format: RRGGBB, #RRGGBB, r,g,b"

        Here is another example using the DateRestrictionValidator
        1. Go to this page, and look for the demo "Please no Mondays...!"
        http://www.irian.at/trinidad-demo/faces/convertValidate/dateRestrictionValidate.jspx

        2. Pick a Monday and submit, get the following error:
        Enter a date from the following weekday(s): .

        It should be an array of days that are permissible.
        2.
        Gabrielle Crawford made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s  1.2.8-core [ 12313041 ]
        Fix Version/s  1.0.8-core [ 12313040 ]
        Gabrielle Crawford made changes -
        Assignee Gabrielle Crawford [ gabrielle ]
        Matthias Weßendorf made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development