Hi all-
I am trying to store a session variable and then use it to modify the menu in Boot.scala. Here is how I am storing the variable in a snippet:
object sessionUserType extends SessionVar[String](null)
def list (xhtml : NodeSeq) : NodeSeq = {
Helpers.bind("sendTo", xhtml,
"provider" -> SHtml.link("/providerlogin",() => sessionUserType("provider"), Text("Provider")),
"student" -> SHtml.link("/studentlogin",() => sessionUserType("student"), Text("Student")))
}
Then in Boot.scala I do this:
val studentSessionType = If(() => S.getSessionAttribute("sessionUserType").open_!.equals("student"),
"not a student session")
I also tried to call the object by name (sessionUserType), but it can never find it, so I thought this might work, but I keep getting an empty box when i access it even though the actual binding and function get executed prior to the menu rendering.
Any help would be much appreciated.
Thanks