The foo reference is captured in checkAndSave which is saved on
LiftSession in function mapping.

Br's,
Marius

On Mar 24, 10:23 am, Alex <[email protected]> wrote:
> If I have this in a (not Stateful) Snippet, is the checkAndSave
> closure saving state on the server?  Where is the reference to foo
> saved?
>
>   def add(form: NodeSeq) : NodeSeq = {
>     val foo = Foo.create
>     def checkAndSave(): Unit = foo.validate match {
>       case Nil => foo.save ; S.notice("Started foo: " + foo.body)
>       case xs => S.error(xs) ; S.mapSnippet("Foo.add", doBind)
>     }
>     def doBind(form: NodeSeq) =
>       bind("foo", form,
>         "body" -> foo.body.toForm,
>         "submit" -> submit("Submit", checkAndSave))
>
>     doBind(form)
>   }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to