[Lift] Using the same template from multiple pages

2009-12-28 Thread Naftoli Gugenheim
Currently my menu setup is similar to some examples in that it uses one "edit" template for editing existing items as well as creating new items. Clicking on the menu link directly instantiates a fresh snippet which instantiates a new mapper instance, while clicking an 'edit' link from the "list" p

[Lift] Form does not want to send

2009-12-28 Thread greekscala
Hello Lift people! I am experimenting with Lift for building a web application. I read alot on the list on the ajax subject and I think I get more familiar with. I try to get a form submittet with ajax. I want an easy solution without much code writing. I tried the following suggestion as found h

Re: [Lift] Re: Mapper validation "workflow" thoughts

2009-12-28 Thread Naftoli Gugenheim
Box is a good idea -- it can capture the parsing error etc. Maybe the trait could go in webkit and Mapper and Record could both use it. Would Wizard use it? Slightly off topic, but why do validation functions take an input parameter? How often are they defined outside of a mapper instance?

[Lift] Re: [ANN] Lift 1.1-M8

2009-12-28 Thread joseph hirn
Thanks for the response Indrajit. Yes this is the same issue I had opened 246 for and sorry for beating a dead horse. The thing is that in most cases, you do want to container to provide the db driver. It's bad practice to create a war file with dependence on a specific database, let alone a spec

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

[Lift] Re: Externalizing log4j configuration

2009-12-28 Thread Marius
-Dlog4j.configuration={file URL} ? On Dec 28, 8:56 pm, Derek Chen-Becker wrote: > That's probably the simplest way to do it. You can also use a system > property (can't remember off the top of my head) to tell log4j where to get > its props from, and then just disable Lift's config of log4j by se

Re: [Lift] Externalizing log4j configuration

2009-12-28 Thread Derek Chen-Becker
That's probably the simplest way to do it. You can also use a system property (can't remember off the top of my head) to tell log4j where to get its props from, and then just disable Lift's config of log4j by setting LogBoot.logSetup = () => false in your bootstrap. Derek On Mon, Dec 21, 2009 a

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

[Lift] Re: How to reRender the page via js in Chat demo of the lift ?

2009-12-28 Thread Neil.Lv
OK, Thank you very much! Cheers, Neil On Dec 28, 11:01 pm, Derek Chen-Becker wrote: > If you never want to show more than 5 chats, you need to move the logic for > trimming to 5 chats into the line where you calculate the update. It looks > like you're trying to just update the difference b

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] Snippet lifetime

2009-12-28 Thread Adam Warski
> > > Yes, the article is out of date now... Lift now makes sure that multiple > > references to a single snippet in the same request context use the same > > instance of that snippet. > I see, so the rationale behind using dispatch snippets is out of date also. > Except that you save one refle

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

Re: [Lift] Snippet lifetime

2009-12-28 Thread Alex Boisvert
On Mon, Dec 28, 2009 at 8:04 AM, Adam Warski wrote: > Hello, > > > Yes, the article is out of date now... Lift now makes sure that multiple > references to a single snippet in the same request context use the same > instance of that snippet. > I see, so the rationale behind using dispatch snippet

[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

Re: [Lift] Snippet lifetime

2009-12-28 Thread Adam Warski
Hello, > Yes, the article is out of date now... Lift now makes sure that multiple > references to a single snippet in the same request context use the same > instance of that snippet. I see, so the rationale behind using dispatch snippets is out of date also. Except that you save one reflection

Re: [Lift] How to reRender the page via js in Chat demo of the lift ?

2009-12-28 Thread Derek Chen-Becker
If you never want to show more than 5 chats, you need to move the logic for trimming to 5 chats into the line where you calculate the update. It looks like you're trying to just update the difference between the incoming updates and your current chats. Derek On Sat, Dec 19, 2009 at 3:47 AM, Neil.

Re: [Lift] re: user_id has value, but get constraint exception of it being null, using JPA and Lift 1.1

2009-12-28 Thread Derek Chen-Becker
OK, I see something really odd here. The exception is complaining about a missing "USER_ID" column, but there's no such column in either insert statement: Hibernate: insert into users (firstName, lastName, username, id) values (?, ?, ?, ?) Hibernate: insert into address (addressLineOne, city, stat

Re: [Lift] Snippet lifetime

2009-12-28 Thread Timothy Perrett
Yes, the article is out of date now... Lift now makes sure that multiple references to a single snippet in the same request context use the same instance of that snippet. Reflection snippets do not have the same scope as request vars... rather, the snippet is held in a request var. Cheers, Tim

[Lift] Re: guid - function mapping not occuring for ajax generator rendered by CometActor

2009-12-28 Thread Marius
This was a non trivial hustle to find the cause:) ... See each Lift function is bound to an owner. The owner can be the pageId (generated by Lift) or the Comet ID. In this case since the function is bound from Comet the owner is the Comet ID. Therefore when clicking on "this doesn't (via comet acto

[Lift] Snippet lifetime

2009-12-28 Thread Adam Warski
Hello, on the wiki page about reflection snippets (http://wiki.github.com/dpp/liftweb/about-snippets), it is written: "Every time you call the reflection snippet in your markup code, a new instance is instantiated and the appropriate method invoked" However this doesn't seem to be true (I'm us

Re: [Lift] Re: [ANN] Lift 1.1-M8

2009-12-28 Thread Indrajit Raychaudhuri
Joseph, I assume your concern is same as the one that you had mentioned here: http://github.com/dpp/liftweb/issues/246/find. While this is a genuine case for the scenario you described, marking db driver as 'provided' has the side effect of not being included with the generated war (because th

[Lift] Re: Signup Form: Some error messages are hidden by default

2009-12-28 Thread Marius
IMO should be generated by the same code that generates the form fields so that the field errors to appear nearby the field itself. I assume you are using ProtoUser. Looks like a bug to me. Br's, Marius On Dec 28, 2:36 am, tiro wrote: > Just discovered this issue (1.1-m8): The sign-up form wi