Lift

Lift is one of those frameworks where I return to it and I can’t remember how to use it.  It is really good for interactive pages, but the API is really littered with a lot of stuff.

This seems to be the the standard import:

import net.liftweb.common.{Box,Full,Empty}
import net.liftweb.http.S._
import net.liftweb.http.SHtml._
import net.liftweb.util.Helpers._

AJAX Form

Nested Templates

One way to do a list of object is to use nested templates.  The xhtml will look like this:

Here is how you can use this in a snipped.

val eventTemplate = chooseTemplate("group", "events")
val events = findEvents
val boundEvents = NodeSeq.fromSeq(events.flatMap( event =>
  bind("event", eventTemplate, "name" -> event.name, "description" -> event.description)).toSeq)

net.liftweb.util.Helpers.

Leave a Reply

Your email address will not be published. Required fields are marked *