Skip to content

Instantly share code, notes, and snippets.

@fmpwizard
Created March 22, 2011 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmpwizard/880812 to your computer and use it in GitHub Desktop.
Save fmpwizard/880812 to your computer and use it in GitHub Desktop.
// bind the view to the dynamic HTML
def show(xhtml: Group): NodeSeq = {
val (name, js) = ajaxCall(JE.JsRaw("this.value"),
s => After(200, replace(s)))
bind("select", xhtml,
"state" -> select(AjaxForm.states.map(s => (s,s)),
Full(state), s => state = s, "onchange" -> js.toJsCmd) %
(new PrefixedAttribute("lift", "gc", name, Null)),
"city" -> cityChoice(state) % ("id" -> "city_select"),
"submit" -> submit(?("Save"),
() =>
{S.notice("City: "+city+" State: "+state);
redirectTo("/")}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment