Lift Web Framework

The code:

class JSDialog {
  // build the button... when pressed, present
  // a dialog based on running the _jsdialog_confirm
  // template
  def button(in: NodeSeq) =
  ajaxButton(in,
             () => S.runTemplate(List("_jsdialog_confirm")).
             map(ns => ModalDialog(ns)) openOr
             Alert("Couldn't find _jsdialog_confirm template"))

  // the template needs to bind to either server-side behavior
  // and unblock the UI
  def confirm(in: NodeSeq) =
  bind("confirm", in,
       "yes" -> ((b: NodeSeq) => ajaxButton(b, () =>
        {println("Rhode Island Destroyed")
         Unblock & Alert("Rhode Island Destroyed")})),
       "no" -> ((b: NodeSeq) => <button onclick={Unblock.toJsCmd}>{b}</button>))
}

Lift is Copyright 2007-2010 WorldWide Conferencing, LLC. Distributed under an Apache 2.0 License.
Lift version 2.3 built on Tue Apr 05 13:24:00 PDT 2011.
Stats: Total Memory: 505,806,848 Free Memory: 462,089,088 Open Sessions: 98
Updated At: Wed May 16 20:27:15 PDT 2012 Started At: Mon Mar 26 20:25:42 PDT 2012