目次

Version 1, last updated by timperrett at Nov 28 02:17 UTC

Add custom field types to LiftScreen

Here’s a small snippet showing you how to add custom field types to a single LiftScreen:


object MyScreen extends LiftScreen { 
  val password = new Field { 
    type ValueType = String 
    override def name = "Password" 
    override implicit def manifest = buildIt[String] 
    override def default = "" 
    override def toForm: Box[NodeSeq] = SHtml.password(is, set _) 
  } 
} 

If you need to use something in multiple LiftScreens, you can register a global form builder.