stateful snippet noob question

25 views
Skip to first unread message

Dennis Haupt

unread,
Jun 1, 2015, 8:50:28 AM6/1/15
to lif...@googlegroups.com
hi,

i have a stateful snippet. there are some components that do stuff and then redirect to the current page again. what magic do i have to do so that the current snippet instance is reused?

the current code is

redirectTo(thisPageURL)

what do i have to add here?

Antonio Salazar Cardozo

unread,
Jun 1, 2015, 1:29:46 PM6/1/15
to lif...@googlegroups.com, d.ha...@gmail.com
I believe you can do this:

  S.redirectTo(thisPageURL, this.registerThisSnippet _)

This says “redirect to thisPageURL, and append a query string parameter that will
fire off the function I passed”. The function in this case is registerThisSnippet, which
ensures that the current instance continues to be used when the snippet is referenced
from templates.
Thanks,
Antonio

Dennis Haupt

unread,
Jun 1, 2015, 1:30:43 PM6/1/15
to lif...@googlegroups.com
yes, that is what statefulsnippet itself is doing... thx

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Antonio Salazar Cardozo

unread,
Jun 9, 2015, 1:46:41 PM6/9/15
to lif...@googlegroups.com, d.ha...@gmail.com
On Monday, June 1, 2015 at 1:30:43 PM UTC-4, HamsterofDeath wrote:
yes, that is what statefulsnippet itself is doing... thx

Yep! :)
Thanks,
Antonio
 
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages