[Lift] Re: Lists in snippets / Snippet Failure

2009-03-24 Thread Thomas Rynne
Thank you, It is working now. I am very happy. Thomas --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send

[Lift] Re: Schema management with JPA

2009-03-24 Thread Alex
I decided against JPA because you lose a lot of framework functionality which it seems is unfortunately tied to the Mapper classes. On Mar 23, 12:15 pm, saem wrote: > I suggest checking outhttp://www.liquibase.org/ > > It's the best open source database change management tool I've come > across

[Lift] State and binding

2009-03-24 Thread Alex
If I have this in a (not Stateful) Snippet, is the checkAndSave closure saving state on the server? Where is the reference to foo saved? def add(form: NodeSeq) : NodeSeq = { val foo = Foo.create def checkAndSave(): Unit = foo.validate match { case Nil => foo.save ; S.notice("Sta

[Lift] Re: State and binding

2009-03-24 Thread marius d.
The foo reference is captured in checkAndSave which is saved on LiftSession in function mapping. Br's, Marius On Mar 24, 10:23 am, Alex wrote: > If I have this in a (not Stateful) Snippet, is the checkAndSave > closure saving state on the server?  Where is the reference to foo > saved? > >   de

[Lift] Re: Schema management with JPA

2009-03-24 Thread Derek Chen-Becker
I can't make any guarantees, but this is something we're trying to address with the upcoming Record framework. The other thing is that you can mix the two if there are certain things you like about Mapper (say, MegaProtoUser). Derek On Tue, Mar 24, 2009 at 2:18 AM, Alex wrote: > > I decided aga

[Lift] Re: lift:Menu.group

2009-03-24 Thread bradford
Thanks Derek. I'll give this a shot when I get home. I don't quite understand the purpose of Menu.item, then. Isn't Menu.item what you all use to create links so that they aren't hard coded in all of the pages? What's the best practice: For more information about . For more information about

[Lift] Re: lift:Menu.group

2009-03-24 Thread David Pollak
On Tue, Mar 24, 2009 at 6:55 AM, bradford wrote: > > Thanks Derek. I'll give this a shot when I get home. I don't quite > understand the purpose of Menu.item, then. Isn't Menu.item what you > all use to create links so that they aren't hard coded in all of the > pages? > Yes. > > What's the

[Lift] Re: Schema management with JPA

2009-03-24 Thread David Pollak
On Tue, Mar 24, 2009 at 1:18 AM, Alex wrote: > > I decided against JPA because you lose a lot of framework > functionality which it seems is unfortunately tied to the Mapper > classes. > Mapper is meant primarily to deal with UI and validation, secondarily to deal with mapping to non-human sourc

[Lift] Re: Schema management with JPA

2009-03-24 Thread Alex
That would rock. Having HTML generation part of the orm is making me think twice about the design of this framework. It seems very wrong to me. On Mar 24, 6:05 am, Derek Chen-Becker wrote: > I can't make any guarantees, but this is something we're trying to address > with the upcoming Record fr

[Lift] Build Comet applications using Scala, Lift, and jQuery

2009-03-24 Thread Michael
http://www.ibm.com/developerworks/ajax/tutorials/wa-aj-comet/ Thanks to Jorge and David for helping me out with the CometActors. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, s

[Lift] Re: Build Comet applications using Scala, Lift, and jQuery

2009-03-24 Thread marius d.
Outstanding and congrats ! On Mar 24, 4:42 pm, Michael wrote: > http://www.ibm.com/developerworks/ajax/tutorials/wa-aj-comet/ > > Thanks to Jorge and David for helping me out with the CometActors. --~--~-~--~~~---~--~~ You received this message because you are sub

[Lift] Re: Build Comet applications using Scala, Lift, and jQuery

2009-03-24 Thread David Pollak
Sweet stuff. Thanks! On Tue, Mar 24, 2009 at 7:42 AM, Michael wrote: > > http://www.ibm.com/developerworks/ajax/tutorials/wa-aj-comet/ > > Thanks to Jorge and David for helping me out with the CometActors. > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scal

[Lift] Re: Build Comet applications using Scala, Lift, and jQuery

2009-03-24 Thread Bruce Stephens
On Tue, Mar 24, 2009 at 2:42 PM, Michael wrote: > > http://www.ibm.com/developerworks/ajax/tutorials/wa-aj-comet/ The PDF is 28 pages, because all the listing boxes are squished. (A trivial comment on the content: the Prerequisites section says that the Lift source is required, but actually a r

[Lift] Re: lift:Menu.group

2009-03-24 Thread Charles F. Munat
David Pollak wrote: > What's the best practice: > > For more information about . For more > information about . > > Or > > For more information about foo1. For more > information about foo2. > > > The latter. This allows you to move the pages around on the filesyste

[Lift] Re: lift:Menu.group

2009-03-24 Thread David Pollak
On Tue, Mar 24, 2009 at 9:02 AM, Charles F. Munat wrote: > > David Pollak wrote: > > What's the best practice: > > > > For more information about . For more > > information about . > > > > Or > > > > For more information about foo1. For more > > information about foo2. >

[Lift] Re: State and binding

2009-03-24 Thread Alex
Perhaps this debate has been had before but I didn't see it. I have a feeling this might be contentious. Doesn't this violate the basic tenet that you should not use server side state when you don't have to? There is no reason for instance when someone is submitting a news group posting to bind

[Lift] Re: State and binding

2009-03-24 Thread David Pollak
Alex, If you don't like this design, then you will not like Lift. I have been doing web development since 1995 and building web frameworks since 1996. I have seen a lot of different approaches to web frameworks and the two web frameworks that have the best approach are WebObjects and Seaside. Th

[Lift] newbie issue

2009-03-24 Thread mizage
Hola, Working through the getting started demo getting this error when executing mvn jetty:run for the TODO app: C:\scala\todo\src\main\scala\com\liftworkshop\snippet\Util.scala:3: error: value xml is not a member of package main.scala import scala.xml.{NodeSeq} My eclipse project is also not

[Lift] Re: newbie issue

2009-03-24 Thread Jeff Watson
show us your code for Util.scala please :-) On Tue, Mar 24, 2009 at 1:00 PM, mizage wrote: > > Hola, > > Working through the getting started demo getting this error when > executing mvn jetty:run for the TODO app: > > C:\scala\todo\src\main\scala\com\liftworkshop\snippet\Util.scala:3: > error:

[Lift] Re: State and binding

2009-03-24 Thread marius d.
On Mar 24, 6:53 pm, Alex wrote: > Perhaps this debate has been had before but I didn't see it.  I have a > feeling this might be contentious. > > Doesn't this violate the basic tenet that you should not use server > side state when you don't have to? No. As long as you are binding a function w

[Lift] Re: newbie issue

2009-03-24 Thread mizage
package main.scala.com.liftworkshop.snippet import scala.xml.{NodeSeq} import com.liftworkshop._ import model._ class Util { def in(html: NodeSeq) = if (User.loggedIn_?) html else NodeSeq.Empty def out(html: NodeSeq) = if (!User.loggedIn_?) html else NodeSeq.Empty } --~--~-~--~

[Lift] Re: newbie issue

2009-03-24 Thread David Pollak
In Scala, imports are relative, unless you make them absolute. In this case, your package is main.scala.com.liftworkshop.snippet The: import scala.xml.{NodeSeq} tells the compiler to look for _root_.main.scala.xml.NodeSeq That is not found. There are two ways to deal: 1. Change your package

[Lift] Re: State and binding

2009-03-24 Thread Charles F. Munat
I remain confused by a lot of this stuff. Here is an example: I have a site that creates pages dynamically based on information in a database. A good example is bio pages. Users add their bios, and then the bios are available through a URL. Now if I use, for example, the user's ID in the URL,

[Lift] Re: State and binding

2009-03-24 Thread David Pollak
On Tue, Mar 24, 2009 at 11:02 AM, Charles F. Munat wrote: > > I remain confused by a lot of this stuff. > > Here is an example: > > I have a site that creates pages dynamically based on information in a > database. A good example is bio pages. Users add their bios, and then > the bios are availab

[Lift] Adding / Updating a JsObj

2009-03-24 Thread Tim Perrett
Hey guys, So, I have a JsObj with a bunch of key-value pairs - how can I both add new key pairs or update existing values? I originally had my data being held as Map[String,String], and attempted to convert it to JsObj however this was for some reason causing a massive memory leak which nearly c

[Lift] Re: Adding / Updating a JsObj

2009-03-24 Thread marius d.
Please see def props: List[(String,JsExp)] and def +*(other: JsObj) would this suffice ? +* looks like an awkward name to me ... ++ expresses concatenation better IMHO. Br's, Marius On Mar 24, 8:36 pm, Tim Perrett wrote: > Hey guys, > > So, I have a JsObj with a bunch of key-value pairs

[Lift] Re: Adding / Updating a JsObj

2009-03-24 Thread Timothy Perrett
Hmm, I saw those methods but they are not documented so didnt know what they did! Will +* replace an object thats the same? On Mar 24, 6:45 pm, "marius d." wrote: > Please see > > def props: List[(String,JsExp)] > > and > > def +*(other: JsObj) > > would this suffice ? > > +* looks like an awkw

[Lift] Re: State and binding

2009-03-24 Thread Charles F. Munat
Glad to see I have been using best practices... I am in complete agreement about form field names, and I like the added benefit that they're obscured. One area where the continuations are very useful is in multipage forms. I like the idea of being able to, for example, stop halfway through a

[Lift] AJAX and IE6. No love.

2009-03-24 Thread Charles F. Munat
I have a survey online that updates the server via AJAX when individual form fields are blurred. Works beautifully in Firefox, Opera, IE7, etc. But in IE6 there are some serious problems. Unfortunately, the users of this survey are corporate, and some of them are forced to use IE6 (DEATH to la

[Lift] Re: AJAX and IE6. No love.

2009-03-24 Thread David Pollak
Charles, If you could post an example site (or send me code to run locally), I'll work on finding a solution for you. Thanks, David On Tue, Mar 24, 2009 at 12:22 PM, Charles F. Munat wrote: > > I have a survey online that updates the server via AJAX when individual > form fields are blurred.

[Lift] Re: Adding / Updating a JsObj

2009-03-24 Thread Timothy Perrett
Hmm, it seems like this is not enough as lists do not care for keys. In my use case, im actually building a library for something that provide default options that are inserted into a flash object. So, given: { key: 'value', something: 'else' } I *need* to only have one of the "something" key, a

[Lift] Re: Adding / Updating a JsObj

2009-03-24 Thread marius d.
oops typo Perreyt = Perrett :D On Mar 24, 10:15 pm, "marius d." wrote: > On Mar 24, 9:46 pm, Timothy Perrett wrote: > > > Hmm, it seems like this is not enough as lists do not care for keys. > > A valid JSON structure allows multiple properties with the same name > such as: > > var x = { >  nam

[Lift] Re: Adding / Updating a JsObj

2009-03-24 Thread marius d.
On Mar 24, 9:46 pm, Timothy Perrett wrote: > Hmm, it seems like this is not enough as lists do not care for keys. A valid JSON structure allows multiple properties with the same name such as: var x = { name: "Perreyt", name: "Tim" } ... guess what alert(x.name) displays :) ? The props fu

[Lift] Re: Adding / Updating a JsObj

2009-03-24 Thread David Pollak
Tim, I'm suggest going back to using a Map. If you're having problems with Map, then you'll have problems with JsObj. Debug your Map problem and all should be good. Thanks, David On Tue, Mar 24, 2009 at 12:46 PM, Timothy Perrett wrote: > > Hmm, it seems like this is not enough as lists do no

[Lift] Re: Adding / Updating a JsObj

2009-03-24 Thread Timothy Perrett
Hey Marius, > Not difficult but not convenient either such as: > > def update(name: String, newVal: JsExp, obj: JsObj) = (for (found <- > obj.props if found._1 != name) yield found) ::: List(name, newVal) I think your exactly right - its doable, but it just feels dirty. lol. > Personally I'm fi

[Lift] Re: Adding / Updating a JsObj

2009-03-24 Thread marius d.
On Mar 24, 10:27 pm, Timothy Perrett wrote: > Hey Marius, > > > Not difficult but not convenient either such as: > > > def update(name: String, newVal: JsExp, obj: JsObj) = (for (found <- > > obj.props if found._1 != name) yield found) ::: List(name, newVal) > > I think your exactly right - its d

[Lift] Re: AJAX and IE6. No love.

2009-03-24 Thread Charles F. Munat
Will do. David Pollak wrote: > Charles, > > If you could post an example site (or send me code to run locally), I'll > work on finding a solution for you. > > Thanks, > > David > > On Tue, Mar 24, 2009 at 12:22 PM, Charles F. Munat > wrote: > > > I have a survey

[Lift] Re: lift:Menu.group

2009-03-24 Thread bradford
Thanks for the clarification, David, and for your snippet, Derek. I think adding an "always" attribute to Menu.item would be very beneficial. I still don't understand why that's not its default behavior. It looks like I will not be able to use any of lift's Menu tags at this time, because 1) I

[Lift] Re: lift:Menu.group

2009-03-24 Thread David Pollak
There's nothing magic about lift's snippets. You can write your own snippets that do whatever you want. On Mar 24, 2009 4:58 PM, "bradford" wrote: Thanks for the clarification, David, and for your snippet, Derek. I think adding an "always" attribute to Menu.item would be very beneficial. I s

[Lift] Re: State and binding

2009-03-24 Thread Alex
> >  There is no reason for instance > > when someone is submitting a news group posting to bind an empty > > posting in a closure and store it on the server, thereby breaking the > > application in any number of cases: > > > 1) The session times out because the user got distracted or lost their >

[Lift] Re: lift:Menu.group

2009-03-24 Thread Charles F. Munat
Bradford, It's easy to change this. I needed similar capabilities. So I simply copied the Menu.scala file into my own file and changed it to MyMenu.scala. Then it's a very quick fix to adapt the item, etc. methods to your own purposes. Took me five minutes, and I had complete control. Just be

[Lift] Re: State and binding

2009-03-24 Thread Charles F. Munat
I think that the two of you are using "break" in different ways. Alex, you mean it doesn't do what the user expects it to do. Marius, I think, means that the application crashes. I agree that this is a nasty behavior. One could say that it's the user's responsibility to keep track of their ses

[Lift] Re: lift:Menu.group

2009-03-24 Thread Derek Chen-Becker
The general case is that a page won't link to itself, I think, which is why the default isn't to show it when the page matches. Unless anyone has objections I can add an "always" attribute. As for #1, the Menu.item makes a link using whatever the contents of the Menu.item tag are for the link text:

[Lift] What a difference a CPU makes

2009-03-24 Thread Derek Chen-Becker
I just wanted to throw this out there in case anyone else is considering new hardware. I had an Athlon X2 4200+ powering my dev box (6GB of ram, 2 x RAID 1 SATA drives) and average build time for a "mvn clean install" for the entire liftweb project was roughly 17 minutes and 45 seconds. I just upgr

[Lift] File <-> Class naming

2009-03-24 Thread Alex Boisvert
Hi Lifters, How would you feel about renaming .scala files to match the main class/trait in them? Let me give you a few examples, lift/src/main/scala/net/liftweb/http/auth/Authentication.scala currently holds a trait named HttpAuthentication. I'd like to rename it HttpAuthentication.scala lift/