Hi. I have found StopValidationOnError trait in Mapper.scala, But I couldn't understand how to use it. Please show me a example.
thanks. On 9月15日, 午前4:08, David Pollak <feeder.of.the.be...@gmail.com> wrote: > I'll check code in after it passes the reviewboard process that let's you > mix in: > trait StopValidationOnError[T] extends Function1[T, List[FieldError]] > > to a validation function such that the validator will stop processing a > given field if a validator that has that trait mixed in returns a validation > error. > > > > > > On Sun, Sep 6, 2009 at 3:02 PM, ishiijp <yoshinori.is...@gmail.com> wrote: > > > I'm looking for a way to stop MappedField validations if prefvious > > validator returns error. > > > For example: > > > object Alphabets extends MappedString(this, 20) { > > override def validations = > > valMinLen(1, "Alphabets is required") _ :: > > valRegex(Pattern.compile("^[a-zA-Z]+$", "It's not alphabets!") > > _ :: > > super.validations > > } > > > if valMinLen returns error, I don't want to process valRegex. > > > My solutions are > > (1) define custom validator which works as I want. > > (2) override MappedField#validate() > > > If you have other ideas, please help me. > > > Thanks in advance. > > -- > Lift, the simply functional web frameworkhttp://liftweb.net > Beginning Scalahttp://www.apress.com/book/view/1430219890 > Follow me:http://twitter.com/dpp > Git some:http://github.com/dpp --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---