wow, thats some ugly code man. Why dont you try something like:
def validateAndSave {
currentEntry.validate match {
case Nil =>
currentEntry.save
S.notice(currentEntry.title + "SAVED!")
case List(fielderror) => S.error(fielderror.msg)
case _ =>
}
}
I havent tested it of course, but just wanna show you how you could tidy up
your code somewhat.
Cheers, Tim
On 6 Feb 2010, at 13:51, wibblecp wrote:
> def validateAndSave (): Unit = currentEntry.validate match {
> case Nil => currentEntry.save ; S.notice(currentEntry.title + "
> SAVED!")
> case x => { x map { (e:FieldError) => S.error(e.msg) } }
> }
--
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=en.