Skip to content

Instantly share code, notes, and snippets.

@lopex
Created January 8, 2011 14:58
Show Gist options
  • Save lopex/770900 to your computer and use it in GitHub Desktop.
Save lopex/770900 to your computer and use it in GitHub Desktop.
import _root_.net.liftweb.mapper._
import _root_.net.liftweb.http._
import _root_.net.liftweb.common.{Full, Box}
import _root_.scala.xml.{NodeSeq, Elem}
trait ErrorMessageSupport extends BaseMappedField {
self: MappedField[_,_] =>
abstract override def _toForm:Box[Elem] = toForm(super._toForm.open_!)
def toForm(in: NodeSeq) = Full(
<div>
{in}
<div class="error_msg"><lift:msg id={uniqueFieldId.open_!}/></div>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment