I found this answer on
nabble<http://old.nabble.com/How-to-disable-a-textfield-td25969916.html>but
it's regarding setting the values client side.  I want to set them in
the snippet, depending on data.
This doesn't work, but will give you a better idea of what I'm trying to do:
 def bindPerson(xhtml: NodeSeq, action: () => Unit, submitButtonName:
String, disableAll: boolean): NodeSeq = {
    // Hold a val here so that the "id" closure holds it when we re-enter
this method
    val currentId = person.id
    val disableString :String = disableAll match {
      case true => "disabled"
      case false => ""
    }
    bind("person", xhtml,
      "id" -> SHtml.hidden(() => person.id = currentId),
      //      "version" -> SHtml.hidden(() => person.version),
      "firstName" -> SHtml.text(person.firstName, person.firstName = _, "id"
-> "firstName", "disabled" -> disableString),
      "middleName" -> SHtml.text(person.middleName, person.middleName = _,
"id" -> "middleName", "disabled" -> disableString),
      "lastName" -> SHtml.text(person.lastName, person.lastName = _, "id" ->
"lastName", "disabled" -> disableString),
      "submit" -> SHtml.submit(?(submitButtonName), action))
  }

-- 
James A Barrows

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to