If I have a model "Item" as follows,

class Item extends LongKeyedMapper[Item] with IdPK{

  def getSingleton = Item

  object chiBrandName extends MappedPoliteString(this,255)

  object engBrandName extends MappedPoliteString(this,255)
}


An item is valid if and only if at least one of the brand name is non-
empty.

But from the lift example, field validation is done by overriding the
validations method of each field and the validate method of the
LongKeyedMetaMapper will invoke all validations method of its fields
and return the list of FieldError if any.

Is there anyway to implement my requirement in lift Mapper with
something like (Sorry for my bad lift syntax, still learning :) )

  def isValidItem = {
     if ( (chiBrandName eq null) || chiBrandName.length == 0) &&
(engBrandName eq null) || engBrandName.length == 0) )
         // show the field error
     else Nil
  }

Thanks

--

You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=.


Reply via email to