Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Does EditorValueParser get called before CustomValidator?

    I have a FloatItem on a form with an EditorValueParser, and a CustomValidator. Should I expect the value returned from the parser to be the value that gets passed to the CustomValidator? Or does the CustomValidator get called before the parser?

    #2
    The parser is first.

    Comment


      #3
      Thanks for the ultra-quick response. I have a related question. What type of Object should the parser return? Right now I'm returning a Double. Should it be a Float?

      And if I don't have a parser, should the CustomValidator expect the value to be a Float?

      Comment


        #4
        Either Float or Double should be OK, both become JavaScript Number objects, which are, roughly speaking, in between Float and Double precision.

        If you don't have a parser, your custom validator should be ready to receive a String even if the field is declared as type "float", since the (implicit) type-based validator will turn valid user input into Floats, but will pass invalid input along to the next validator still as a String.

        Comment

        Working...
        X