On Wed, Feb 10, 2010 at 2:47 PM, ced <[email protected]> wrote:
> Hi everybody,
>
> I'm having a JsonHandler object inside a snippet and I want to access
> some vals from to enclosing snippet. But unfortunately this doesn't
> work, because it seems that there is just one single instance per
> session and class name maintained by Lift. Having a fresh handler per
> snippet would let me easily capture some state from the enclosing
> snippet instance, but as the same JsonHandler gets reused in setting
> up the Javascript for callback, this is not working.
>
> Is there a way to remove the registered handler from the session?
> LiftSession.set and unset aren't accessible for the outside world. Or
> to enforce to have a new handler everytime?
>
> I'm using Lift 1.1-M8.
>
>
If you use this:
val (call: JsonCall, jsCmd: JsCmd) = S.buildJsonFunc{
case ... => ...
}
You'll get a new JSON Handler, closed over the variables in your snippet for
each new instance of your snippet.
Is that what you're looking for?
> Thanks for any ideas,
> Chris
>
> --
> 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]<liftweb%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>
>
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics
--
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.