The StatefulSnippet is not a snippet instance that is always used in
the context of your session.

1. You can use it to work with the same instance across multiple
snippet functions ... when rendering a more complex page an you want
to avoid RequestVar-s but keep state for current rendering pipeline in
the snippet.
2. You can indicate that you want to reuse the same instance across
multiple pages using link or redirectTo functions from the
StatefulSnippet

So depending what you want to doyou can use the statefull or stateless
nature of snippets. For stateless snippets you can just declare the
class and the method and just use it. Such as:

class Foo {

  def bar(xml: NodeSeq) :NodeSeq = ...
}

.. and in your markup

<lift:Foo.bar/>

you can also say

class Foo  extends DispatchSniuppet {

   def dispatch = ...
}

which is also a stateless snippet.

Br's,
Marius

On Apr 11, 7:21 am, Oliver Lambert <[email protected]> wrote:
> I have a stateful snippet that doesn't always appear to work with the back
> button.
> Sometimes, when the back button is used, a new stateful snippet instance
> appears to be created. Has this happened to anyone else?
>
> Anyway, I've converted what I had to use a SessionVar to store the state.
> Should I replace the stateful snippet with a stateless one - does a stateful
> snippet that isn't storing any state have any extra overhead over a
> stateless one?
>
> If I do use a stateless snipet can I still have a dispatch method?
>
> cheers
> Oliver
--~--~---------~--~----~------------~-------~--~----~
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