Tapestry
  1. Tapestry
  2. TAPESTRY-1170

Problem with dojo.validate.isInRange(), desired flexibility in Tapestry validators

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.1.1
    • Component/s: Framework, JavaScript
    • Labels:
      None

      Description

      The bug is really in dojo.validate.isInRange(), but it can be worked around with a change in the validator call.

      I have a custom validator that allows numeric values with comma separators. It uses dojo.validate.isInteger() with the separator parameter.

      This should work with dojo.validate.isInRange(), but it has a bug:

      value = value.replace(dojo.lang.has(flags,'separator')?flags.separator:',', '', 'g').
      replace(dojo.lang.has(flags,'symbol')?flags.symbol:'$', '');

      the default if flags does not have the separator property (which it won't from Min and Max) should be

      /,/g

      instead of ','. String.replace() doesn't take 3 parameters in IE 6, it takes 2, and the first one is a regular expression.

      I can redefine this function for now, but I'd like to see the Tapestry validators allow for configuration of separators too.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Greg Woolsey
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development