Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread Adam Warski
Hello, Well for changing the tutorial form into an ajax form I guess the best solution is to store the model instance in a RequestVar and simply set it to a new instance after saving. So I don't have any immediate use-cases. But in other (Seam) projects I remember that I used the event

Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread Adam Warski
Hello, That's true in practice. The implementation of those methods however are equivalent to the S and SHtml versions except for the call to registerThisSnippet. But if Lift will sometimes remember even ordinary class instances as reusable snippets then why should the API for managing

Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread Timothy Perrett
These are the names we use in Lift - appreciate what your saying, but its not confusing IMHO, just different to other things you are used to. Lift is Lift, not RoR, or Seam, or any other framework ;-) Cheers, Tim On 29 Dec 2009, at 10:04, Adam Warski wrote: By the way, I find the names

Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread Adam Warski
Hello, These are the names we use in Lift - appreciate what your saying, but its not confusing IMHO, just different to other things you are used to. Lift is Lift, not RoR, or Seam, or any other framework ;-) Sure, it's just a simple terminology switch, I don't really mind if they are named

Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread Alex Boisvert
I found RequestVar surprising/confusing at first, too, because I assumed its scope would be a single request -- but clearly isn't. My suggestion here would be to rename RequestVar to PageVar since that's closer to its lifecycle and rename TransientRequestVar to RequestVar based on my initial

Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread David Pollak
On Tue, Dec 29, 2009 at 1:58 AM, Adam Warski a...@warski.org wrote: Hello, Well for changing the tutorial form into an ajax form I guess the best solution is to store the model instance in a RequestVar and simply set it to a new instance after saving. So I don't have any immediate

[Lift] Re: Snippet lifetime

2009-12-28 Thread Marius
RequestVar-s lifetime is expanded beyond the actual request, which is not applicable for TransientRequestVar. For instance say you have a page and you set some state on a RequestVar ... then you render an Ajax link. After the page is rendered, when your ajax function is invoked, you RequestVar

Re: [Lift] Re: Snippet lifetime

2009-12-28 Thread Adam Warski
Hello, RequestVar-s lifetime is expanded beyond the actual request, which is not applicable for TransientRequestVar. For instance say you have a page and you set some state on a RequestVar ... then you render an Ajax link. After the page is rendered, when your ajax function is invoked, you

[Lift] Re: Snippet lifetime

2009-12-28 Thread Marius
On Dec 28, 7:19 pm, Adam Warski a...@warski.org wrote: Hello, RequestVar-s lifetime is expanded beyond the actual request, which is not applicable for TransientRequestVar. For instance say you have a page and you set some state on a RequestVar ... then you render an Ajax link. After

Re: [Lift] Re: Snippet lifetime

2009-12-28 Thread Adam Warski
Hello, 1) Can I have in lift a true request variable/snippet, that is such which has a lifetime of one request (without any ajax callbacks)? I can't use TransientRequestVar because it's private. It would be useful to complete my ajax-form example (after an item is saved, a new one should

Re: [Lift] Re: Snippet lifetime

2009-12-28 Thread Naftoli Gugenheim
And what's the difference to a StatefulSnippet? - Adam Warskia...@warski.org wrote: Hello, RequestVar-s lifetime is expanded beyond the actual request, which is not applicable for TransientRequestVar. For instance say you have a page and you set some state

[Lift] Re: Snippet lifetime

2009-12-28 Thread Marius
On Dec 28, 7:46 pm, Adam Warski a...@warski.org wrote: Hello, 1) Can I have in lift a true request variable/snippet, that is such which has a lifetime of one request (without any ajax callbacks)? I can't use TransientRequestVar because it's private. It would be useful to complete my

Re: [Lift] Re: Snippet lifetime

2009-12-28 Thread Alex Boisvert
StatefulSnippets lifetime is manually managed and may be chained to other pages by using link() or redirectTo() such that the same instance is reused for those targets. (And StatefulSnippet extends DispatchSnippet) alex On Mon, Dec 28, 2009 at 10:08 AM, Naftoli Gugenheim

Re: [Lift] Re: Snippet lifetime

2009-12-28 Thread Naftoli Gugenheim
That's true in practice. The implementation of those methods however are equivalent to the S and SHtml versions except for the call to registerThisSnippet. But if Lift will sometimes remember even ordinary class instances as reusable snippets then why should the API for managing reused

Re: [Lift] Re: Snippet lifetime

2009-12-28 Thread Ross Mellgren
On Dec 28, 2009, at 12:46 PM, Adam Warski wrote: Hello, 1) Can I have in lift a true request variable/snippet, that is such which has a lifetime of one request (without any ajax callbacks)? I can't use TransientRequestVar because it's private. It would be useful to complete my

[Lift] Re: Snippet lifetime

2009-12-28 Thread Marius
On Dec 28, 9:11 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: That's true in practice. The implementation of those methods however are equivalent to the S and SHtml versions except for the call to registerThisSnippet. But if Lift will sometimes remember even ordinary class instances

Re: [Lift] Re: Snippet lifetime

2009-12-28 Thread Naftoli Gugenheim
It could be changed, if it's thought worth it, once we are on 2.8. You need a package level type alias (and def pointing to the factory). Change the name to PageVar and add some deprecated aliases. But it would be silly. Someone needed a feature--accessing a RequestVar from ajax. So now its