On Aug 5, 9:16 am, Naftoli Gugenheim <naftoli...@gmail.com> wrote:
> But when I navigate from that page back will it still be registered?
> Page load 1 - snippet instantiated
> Button clicked - redirect, register snippet
> Page load 2 (somewhere else)

This "somewhere else" is still a Lift page right? ... if so when page
2 loads your provided function will be executed. You can keep a
reference to registerThisSnippet function say in a RequestVar. When
page 2 renders and you bind a function to that button for function
button you would call S.redirectTo(ur, and the function from your
request-var). hence

> Button clicked - redirect to prev page
> Page load 3 - snippet still registered?
> Do I have to store a call to registerSnippet in the other page?
>
> -------------------------------------
>
> marius d.<marius.dan...@gmail.com> wrote:
>
> In StatefulSnippet you have a redirectTo function that essentially
> does a redirect with state
>
> The definition is something like:
>
> def redirectTo(where: String) = S.redirectTo(where,
> registerThisSnippet)
>
> So you can do it like
>
> S.redirectTo(where, () => registerThisSnippet)
>
> ... of course would be a bit more complex but the point is that you
> can capture registerThisSnippet function with a lambda expression or
> whatever and use it later on when render the page.
>
> Br's,
> Marius
>
> On Aug 5, 6:20 am, Naftoli Gugenheim <naftoli...@gmail.com> wrote:
>
> > How can a StatefulSnippet redirect to a page that does not use it, which 
> > links or redirects back to it and it needs to remember its state?
--~--~---------~--~----~------------~-------~--~----~
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