Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-820

Translator and Validator causes confusion

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 4.1.1
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      any

      Description

      Currently in order to use anything but a String value combined with the new validators logic you have to add in an additional binding for the "translator":

      <component id="defvalue" type="TextField">
      <binding name="value" value="ognl:event.defaultValue"/>
      <binding name="displayName" value="message:event.decimal.defaultValue"/>
      <binding name="validators" value="validators:real"/>
      <binding name="translator" value="translator:number,pattern=#.##" />
      </component>

      This is not at all obvious for normal usage. I think the old validators method of combining the value type (if not string) along with the rest of the parameters into one single string is still better.

      It would probably be a good idea to actually make the inferred object type argument work It can be a combination of the validators they are applying along with what the actual target value binding class type is. Shouldn't be too hard.

        Attachments

          Activity

            People

            • Assignee:
              jkuhnert Jesse Kuhnert
              Reporter:
              jkuhnert Jesse Kuhnert
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: