stateful snippet noob question

瀏覽次數:25 次
跳到第一則未讀訊息

Dennis Haupt

未讀,
2015年6月1日 上午8:50:282015/6/1
收件者: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

未讀,
2015年6月1日 下午1:29:462015/6/1
收件者: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

未讀,
2015年6月1日 下午1:30:432015/6/1
收件者: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

未讀,
2015年6月9日 下午1:46:412015/6/9
收件者: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.
回覆所有人
回覆作者
轉寄
0 則新訊息