1 2 3 4 5 6 7 8 9 10 11 | < div id = "main" class = "lift:surround?with=default&at=content" > < div > Let's use Lift's LiftScreen to build complex simple screen input forms. </ div > < div class = "lift:ScreenExample" > Put your form here </ div > </ div > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | package code package snippet import net.liftweb. _ import http. _ /** * Declare the fields on the screen */ object ScreenExample extends LiftScreen { // here are the fields and default values val name = field( "Name" , "" ) // the age has validation rules val age = field( "Age" , 0 , minVal( 13 , "Too Young" )) def finish() { S.notice( "Name: " +name) S.notice( "Age: " +age) } } |
(C) 2012 David Pollak