Skip to content

Instantly share code, notes, and snippets.

@ignatov
Created June 29, 2011 12:33
Show Gist options
  • Save ignatov/1053739 to your computer and use it in GitHub Desktop.
Save ignatov/1053739 to your computer and use it in GitHub Desktop.
Set values to mbr.comment
/** Set value to mbr.comment from mbr.tag() */
private def setCurrent(mbr: MemberEntity, isSelf: Boolean) = {
def doo(mbr: MemberEntity, isSelf: Boolean)() = {
println(mbr.tag())
val value = mbr.tag() match {
case c: Comment => c.comment.is
case s: String => s
case _ => "None"
}
println(value)
mbr.comment.get.update(value)
println(mbr)
println(mbr.comment)
Noop
}
SHtml.a(doo(mbr, isSelf) _, Text("Activate"), ("class", "button"))
}
/** Set "Value" to mbr.comment. */
private def setPredefined(mbr: MemberEntity, isSelf: Boolean) = {
def doo(mbr: MemberEntity, isSelf: Boolean)() = {
val value = "Value"
println(value)
mbr.comment.get.update(value)
println(mbr)
println(mbr.comment)
Noop
}
SHtml.a(doo(mbr, isSelf) _, Text("Activate 'Value'"), ("class", "button"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment