2 Replies Latest reply on Aug 6, 2008 11:11 PM by Gregory Lafrance

    Localizable validators?

    justria Level 1
      In my code, validators tend to be big and ugly, since I need to supply localized error messages:

      quote:

      <mx:NumberValidator
      source="{prHourlyRate}" property="text"
      minValue="0" maxValue="10" domain="int"
      exceedsMaxError="@Resource(bundle='rStrings', key='vlNotLargerThan200')"
      lowerThanMinError="@Resource(bundle='rStrings', key='vlNotLessThan0')"
      invalidCharError="@Resource(bundle='rStrings', key='vlInvalidCharsINT')"
      invalidFormatCharsError="@Resource(bundle='rStrings', key='vlInvalidCharsINT')"
      />


      I definitely could implement a CLocNumberValidator validator as a subclass of NumberValidator and attach localized default messages.

      On the other hand, I don't want to reinvent the wheel: Do we have a standard approach, e.g. a special properties resource I need to implement?