Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread David Pollak
On Mon, Dec 28, 2009 at 11:11 AM, Naftoli Gugenheim 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 as reusab

Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread David Pollak
On Mon, Dec 28, 2009 at 11:26 AM, Naftoli Gugenheim wrote: > 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. > It's not a PageVar. The name wi

Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread David Pollak
On Tue, Dec 29, 2009 at 1:58 AM, Adam Warski 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 use-cases. > >> >

Re: [Lift] Re: Snippet lifetime

2009-12-29 Thread David Pollak
On Tue, Dec 29, 2009 at 10:22 AM, Alex Boisvert wrote: > 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 r

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 expec

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 nam

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 Reque

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 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

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 sema

[Lift] Re: Snippet lifetime

2009-12-28 Thread Marius
On Dec 28, 9:11 pm, Naftoli Gugenheim 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 as reusable snippe

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 com

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 snippets

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 wrote: > And what's t

[Lift] Re: Snippet lifetime

2009-12-28 Thread Marius
On Dec 28, 7: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

Re: [Lift] Re: Snippet lifetime

2009-12-28 Thread Naftoli Gugenheim
And what's the difference to a StatefulSnippet? - Adam Warski 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 Request

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

[Lift] Re: Snippet lifetime

2009-12-28 Thread Marius
On Dec 28, 7:19 pm, Adam Warski 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 the page

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, y

[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 stat