[Lift] Re: Exception for S.? while booting

2009-08-05 Thread marius d.
I'm aware about the override thing but I don't see why you would do it in such way. Since you don't have state, you don't have a session = you don't have S. Are you using a statelesDispatchPf ? You can do: 1. Use your own ResourceBundles 2. Or a hacky thingy like: val session =

[Lift] Re: Exception for S.? while booting

2009-08-05 Thread Naftoli Gugenheim
The point marius was making is that if it was a def or lazy val it wouldn't get called so early. - Heiko Seebergerheiko.seeber...@googlemail.com wrote: def can be overridden with val. But this is a Scala thingy, please do not bother. If it makes you easier

[Lift] Re: Extend StatefulSnippet lifetime

2009-08-05 Thread Naftoli Gugenheim
But when I navigate from that page back will it still be registered? Page load 1 - snippet instantiated Button clicked - redirect, register snippet Page load 2 (somewhere else) Button clicked - redirect to prev page Page load 3 - snippet still registered? Do I have to store a call to

[Lift] Re: Extend StatefulSnippet lifetime

2009-08-05 Thread marius d.
On Aug 5, 9:16 am, Naftoli Gugenheim naftoli...@gmail.com wrote: But when I navigate from that page back will it still be registered? Page load 1 - snippet instantiated Button clicked - redirect, register snippet Page load 2 (somewhere else) This somewhere else is still a Lift page right?

[Lift] Re: Extend StatefulSnippet lifetime

2009-08-05 Thread Naftoli Gugenheim
Okay. Thanks. - marius d.marius.dan...@gmail.com wrote: On Aug 5, 9:16 am, Naftoli Gugenheim naftoli...@gmail.com wrote: But when I navigate from that page back will it still be registered? Page load 1 - snippet instantiated Button clicked - redirect,

[Lift] Re: Or QueryParams

2009-08-05 Thread Timothy Perrett
You can get items from the query string by doing: S.param(theparam) // Box[T] Cheers, Tim On Aug 5, 4:22 am, Naftoli Gugenheim naftoli...@gmail.com wrote: How can you Or QueryParams (e.g. find text in any field)? Thanks. --~--~-~--~~~---~--~~ You received this

[Lift] Re: Dynamically setting class attribute on div or span

2009-08-05 Thread Timothy Perrett
You might want to checkout the wiki - answers to your questions are on there: http://wiki.github.com/dpp/liftweb Cheers, Tim On Aug 4, 11:22 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: See Exploring Lift 7.6.2. In short, the lift:snippet specifies a method that returns extra attributes.

[Lift] Re: *** BREAKING CHANGES COMING UP SOON ***

2009-08-05 Thread Timothy Perrett
Portlets have some mixed press, so im not sure how much of a win that will be. The AsyncWeb / Netty stuff does look pretty freaking cool tho. Cheers, Tim On Aug 4, 10:40 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: Cool. I'll have to look at portlets and see what they do. Derek On

[Lift] Re: Exception for S.? while booting

2009-08-05 Thread Heiko Seeberger
Ah, yes!Sorry, I did not get the point, but obviously the val is to be blamed ;-) Now it's running, thanx!!! Heiko 2009/8/5 marius d. marius.dan...@gmail.com I'm aware about the override thing but I don't see why you would do it in such way. Since you don't have state, you don't have a

[Lift] Re: Or QueryParams

2009-08-05 Thread Naftoli Gugenheim
- Timothy Perretttimo...@getintheloop.eu wrote: You can get items from the query string by doing: S.param(theparam) // Box[T] Cheers, Tim On Aug 5, 4:22 am, Naftoli Gugenheim naftoli...@gmail.com wrote: How can you Or QueryParams (e.g. find text in any

[Lift] Re: Title function

2009-08-05 Thread Derek Chen-Becker
The snippet itself can bind the title if it has the head inside it. Something like: lift:surround at=content lift:MySnippet.method head titlemysnippet:title //title /head ... /lift:MySnippet.method /lift:surround This is what I do (with no title element in the default template). Derek On

[Lift] Re: jQuery - esp. datepicker

2009-08-05 Thread Derek Chen-Becker
1) yes. That's why I would suggest using a class instead if you have multiple date fields. We just used an id in this case because there was only one date field on the page. 2) I agree. I don't know why you were getting that error :( Lift has jquery bundled with it. You should be able to include

[Lift] Re: Using ExtJS with Lift?

2009-08-05 Thread Derek Chen-Becker
Your guess is correct. The jquery-ui-min.js contains the datePicker. We used to use datePicker.js but then we switched to the datePicker that's in jquery UI. As for your question about where to put the scripts, you don't want to put them in src/main/resources/toserve unless you're writing a

[Lift] Re: Using ExtJS with Lift?

2009-08-05 Thread Derek Chen-Becker
OK, so on re-read I totally misunderstood the question :P. If you write your own maven project you could put the scripts under src/main/resources/toserve/extjs (per your Boot example setting up ResourceServer). No need to hack on the lift module itself. Derek On Wed, Aug 5, 2009 at 4:23 AM,

[Lift] Re: Converting from HTML form values to numeric MappedFields

2009-08-05 Thread Derek Chen-Becker
I think that you'll need to provide your own _toForm method on the field. Fortunately, it's a pretty trivial method (from MappedField.scala): 1. /** 2.* Create an input field for the item 3.*/ 4. override def _toForm: Box[NodeSeq] = 5. S.fmapFunc({s: List[String] =

[Lift] Re: *** BREAKING CHANGES COMING UP SOON ***

2009-08-05 Thread Yousry Abdallah
Could you setup a milestone before the merge? On 4 Aug., 21:51, Marius marius.dan...@gmail.com wrote: Folks, I spent a few days decoupling Lift from JEE web container dependencies: javax.servlet._ The code is currently in wip-marius-http- abstractions. I still need to nail down a few

[Lift] Re: *** BREAKING CHANGES COMING UP SOON ***

2009-08-05 Thread marius d.
Sounds good to me On Aug 5, 1:51 pm, Yousry Abdallah yous...@gmail.com wrote: Could you setup a milestone before the merge? On 4 Aug., 21:51, Marius marius.dan...@gmail.com wrote: Folks, I spent a few days decoupling Lift from JEE web container dependencies: javax.servlet._ The code

[Lift] Re: *** BREAKING CHANGES COMING UP SOON ***

2009-08-05 Thread Derek Chen-Becker
Netty looks really cool. On a quick read it sounds maybe a little like MINA, although it definitely looks like it has a more high-level API to simplify things. On Wed, Aug 5, 2009 at 5:08 AM, marius d. marius.dan...@gmail.com wrote: Sounds good to me On Aug 5, 1:51 pm, Yousry Abdallah

[Lift] Re: *** BREAKING CHANGES COMING UP SOON ***

2009-08-05 Thread marius d.
And looks to perform a bit better then MINA. On Aug 5, 2:13 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: Netty looks really cool. On a quick read it sounds maybe a little like MINA, although it definitely looks like it has a more high-level API to simplify things. On Wed, Aug 5, 2009

[Lift] Re: Lift w/o ajax

2009-08-05 Thread David Pollak
The functions will be kept for the duration of the user's session... if they're coming from a mobile device, it's unlikely that they'll accumulate too much garbage and it's unlikely that it'll be a serious issue. If it becomes an issue, we can work on it. On Tue, Aug 4, 2009 at 9:17 PM, Naftoli

[Lift] Re: Or QueryParams

2009-08-05 Thread David Pollak
There's no OR in the Mapper stuff. You'll have to roll your own BySql expression. On Tue, Aug 4, 2009 at 8:22 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: How can you Or QueryParams (e.g. find text in any field)? Thanks. -- Lift, the simply functional web framework

[Lift] Re: Using ExtJS with Lift?

2009-08-05 Thread Stefan Scott
Thanks Derek! On Aug 5, 7:26 am, Derek Chen-Becker dchenbec...@gmail.com wrote: OK, so on re-read I totally misunderstood the question :P. If you write your own maven project you could put the scripts under src/main/resources/toserve/extjs (per your Boot example setting up ResourceServer).

[Lift] Re: Asynchronous Javascript problem

2009-08-05 Thread Channing Walton
ok, lots of jscript debugging and I'm pretty sure its this: JSON.stringify(new GLatLng(0,0)) where GLatLng is a google map object. the imports needed for this are script src=http://maps.google.com/maps? file=apiamp;v=2.xamp;key=your-keyamp;sensor=false type=text/ javascript/script script

[Lift] Re: Title function

2009-08-05 Thread Naftoli Gugenheim
- Naftoli Gugenheimnaftoli...@gmail.com wrote: So what I'm not clear on now is the input to Title. What is a LocParam, and how do you you use loc params? What is forceParam, defaultParams, param, and foundParam? And in any case how can Title know the value

[Lift] Loc.title impl redundancy?

2009-08-05 Thread Naftoli Gugenheim
Why does title: NodeSeq try linkText if title(in:ParamType) calls linkText(in)? Is it possible that (forceParam or foundParam.is or defaultParams) will evaluate differently by that time? --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Lift] Re: New features

2009-08-05 Thread Naftoli Gugenheim
Correction: ModelSnippet.load takes the actual Mapper instance, not the ModelView wrapper. - Naftoli Gugenheimnaftoli...@gmail.com wrote: To answer your immediate question, the listing should not refer to the snippet's view but new ModelView instances for

[Lift] Prepare StatefulSnippet in advance

2009-08-05 Thread Naftoli Gugenheim
Hi. I have one screen, /requests/edit, that links to /clients/edit, in order to edit a specific client. Both use StatefulSnippet. In the link I specify a function that instantiates and registers an instance of that StatefulSnippet. However the page does not use that instance but a new instance

[Lift] Re: Prepare StatefulSnippet in advance

2009-08-05 Thread David Pollak
Please provide a complete (executable) code sample so I can understand the flow. On Wed, Aug 5, 2009 at 9:40 AM, Naftoli Gugenheim naftoli...@gmail.comwrote: Hi. I have one screen, /requests/edit, that links to /clients/edit, in order to edit a specific client. Both use StatefulSnippet. In

[Lift] Re: New features

2009-08-05 Thread glenn
Naftoli, I fixed my code per your comments and now I can edit and remove users from a list, as long as I populate the list with ModelView instances, as you said. As for the docs, this step was not clear to me at all. I just assumed that the list was just populated with User entities and the view

[Lift] Re: Title function

2009-08-05 Thread Derek Chen-Becker
If you're just looking for a way to programmatically set the title, getting into LocParam might be a little bit of overkill. It's probably simpler to set up your own SessionVars or RequestVars and access them from the Title closure:

[Lift] Re: New features

2009-08-05 Thread Naftoli Gugenheim
I'll try. By the way, as per my correction, you can implement list the regular way without ModelView, and just use ModelSnippet's load function in your edit link or button, passing it the User instance. - glenngl...@exmbly.com wrote: Naftoli, I fixed my

[Lift] Re: Title function

2009-08-05 Thread Naftoli Gugenheim
You mean the snippet should put its new/edit flag somewhere that the Title can read, like a top level object? Then it doesn't need to be an AnyVar because it can be set on every request, if Title is processed after the snippet in each request--and if not then I don't see how a RequestVar etc.

[Lift] Re: Mega*ProtoUser extensibility - a suggestion.

2009-08-05 Thread E. Biggs
David, First apologies for accidently taking this thread off the lift group. It was entirely accidental. So my question with regards to the scala language that I can't seem to find an answer for online anywhere is what exactly is an object nested inside a class i.e. : class ObjectWrapper {

[Lift] Re: Asynchronous Javascript problem

2009-08-05 Thread Channing Walton
actually that example doesn't work in Opera, but does in safari and firefox. To see the problem in safari I had to modify the script like this: var geocoder = new GClientGeocoder(); geocoder.getLatLng(london,doit); function doit(point) { var s = JSON.stringify(point); alert(s) } This does

[Lift] Re: Loc.title impl redundancy?

2009-08-05 Thread David Pollak
On Wed, Aug 5, 2009 at 8:56 AM, Naftoli Gugenheim naftoli...@gmail.comwrote: Why does title: NodeSeq try linkText if title(in:ParamType) calls linkText(in)? Because it's possible to subclass the Loc and have your own implementation of linkText. Is it possible that (forceParam or

[Lift] Re: Prepare StatefulSnippet in advance

2009-08-05 Thread Naftoli Gugenheim
I don't have code available to post right now, but let me try to explain better. Basically you're editing a request, which is associated with a client. Now when your entering the request you may notice that the client's info is wrong. So I need a link to the client editing page, which is

[Lift] Re: Prepare StatefulSnippet in advance

2009-08-05 Thread David Pollak
Create a top-level RequestVar: object TheClient extends RequestVar[Box[Client]](Empty) object ReturnToMe extends RequestVar[Box[() = Unit]](Empty) class ClientEditor extends StatefulSnippet { val referer = S.referer openOr / val client = TheClient.is openOr {S.error(client not provided);

[Lift] Re: Prepare StatefulSnippet in advance

2009-08-05 Thread David Pollak
On Wed, Aug 5, 2009 at 1:25 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: I have working now by instantiating a client snippet class and calling S.mapSnippet with the snippet's edit method. But why didn't it work by calling its registerThisSnippet method? because the snippet didn't know

[Lift] Re: Prepare StatefulSnippet in advance

2009-08-05 Thread Naftoli Gugenheim
Okay, that makes sense! I guess it's generated during the xml processing stage? - David Pollakfeeder.of.the.be...@gmail.com wrote: On Wed, Aug 5, 2009 at 1:25 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: I have working now by instantiating a client

[Lift] Comet render and jQuery

2009-08-05 Thread Avo Reid
I am might be going about this in the wrong way but I wanted to get confirmation. I have a comet lift snippet that waits for a comet actor to send down search results triggered by a button click after entering keywords. lift:comet type=SearchActor

[Lift] Re: Code review for some Mailer enhancements

2009-08-05 Thread David Pollak
Spencer, I've taken your suggestions and rolled them into Lift... see the enclosed diff. Thanks for making the suggestion. David On Wed, Jul 8, 2009 at 3:29 PM, Spencer Uresk sur...@gmail.com wrote: As I alluded to in another email, the way Lift's Mailer class works causes some problems

[Lift] More than one lift:surround in HTML file

2009-08-05 Thread pabraham
Hello there, Is it possible for an HTML file to have more than one lift:surround tag? For example, default.html contains ... lift:bind name=content ... lift:bind name=sidebar ... My index.html contains lift:surround with=default at=content pThis is some content/p /lift:surround

[Lift] Re: More than one lift:surround in HTML file

2009-08-05 Thread marius d.
No. Each template must be xml well formed so you can not have more then one root element, Please see lift:with-param to handle multiple binds. Br;s, Marius On Aug 6, 12:04 am, pabraham paulabraham...@googlemail.com wrote: Hello there, Is it possible for an HTML file to have more than one

[Lift] Re: More than one lift:surround in HTML file

2009-08-05 Thread Naftoli Gugenheim
XML documents need to have a single top-level element. Surround the whole index.html with lift:children. - pabrahampaulabraham...@googlemail.com wrote: Hello there, Is it possible for an HTML file to have more than one lift:surround tag? For example,

[Lift] Re: More than one lift:surround in HTML file

2009-08-05 Thread pabraham
I've added lift:children to my index.html file and now get: XML Parsing Error: junk after document element Location: http://192.168.96.150:8080/ Line Number 113, Column 1:html xmlns:lift=http://liftweb.net/; xmlns=http://www.w3.org/1999/xhtml; ^ Any ideas? In the meantime I can look at

[Lift] Re: More than one lift:surround in HTML file

2009-08-05 Thread Naftoli Gugenheim
Which browser gives that error? What do you see in View Source? - pabrahampaulabraham...@googlemail.com wrote: I've added lift:children to my index.html file and now get: XML Parsing Error: junk after document element Location: http://192.168.96.150:8080/

[Lift] Eclipse setup

2009-08-05 Thread steffen.weissmann
I have trouble with getting started with lift in eclipse. In my project, created from lift-archetype-basic 1.1-SNAPSHOT, i have all the lift jars with attached sources (all in the maven repository) under Referenced Libraries. I can also browse the source code by double-clicking on the classes

[Lift] Re: Eclipse setup

2009-08-05 Thread Miles Sabin
On Wed, Aug 5, 2009 at 10:21 PM, steffen.weissmannsteffen.weissm...@googlemail.com wrote: I have trouble with getting started with lift in eclipse. In my project, created from lift-archetype-basic 1.1-SNAPSHOT, i have all the lift jars with attached sources (all in the maven repository) under

[Lift] Re: Eclipse setup

2009-08-05 Thread Steffen Weißmann
Can you show me the contents of your .project and .classpath files. Both files attached. Thanks for looking into it... On Wed, Aug 5, 2009 at 11:34 PM, Miles Sabinmi...@milessabin.com wrote: On Wed, Aug 5, 2009 at 10:21 PM, steffen.weissmannsteffen.weissm...@googlemail.com wrote: I have

[Lift] Re: Exception for S.? while booting

2009-08-05 Thread Naftoli Gugenheim
I just read the scaladoc comment of S.init. Does it have anything to do with this subject? - Heiko Seebergerheiko.seeber...@googlemail.com wrote: Ah, yes!Sorry, I did not get the point, but obviously the val is to be blamed ;-) Now it's running, thanx!!!

[Lift] Re: Eclipse setup

2009-08-05 Thread Miles Sabin
On Wed, Aug 5, 2009 at 10:39 PM, Steffen Weißmannsteffen.weissm...@googlemail.com wrote: Can you show me the contents of your .project and .classpath files. Both files attached. Thanks for looking into it... OK, you have two problem here (which are Scala IDE bugs, so I was a bit harsh on

[Lift] Re: More than one lift:surround in HTML file

2009-08-05 Thread Timothy Perrett
Marius is right, use with-param... That's the correct solution here. Cheers, Tim On 05/08/2009 22:19, pabraham paulabraham...@googlemail.com wrote: I've added lift:children to my index.html file and now get: XML Parsing Error: junk after document element Location:

[Lift] Re: New features

2009-08-05 Thread glenn
Naftoli, Hate to do this to you, but I'm getting the following error using ManyToMany for Users to Roles: Message: java.lang.RuntimeException: Broken join scala.Predef$.error(Predef.scala:76) net.liftweb.mapper.ManyToMany$MappedManyToMany$$anonfun$children$1$

[Lift] Re: Asynchronous Javascript problem

2009-08-05 Thread Channing Walton
ok I've done that: git://github.com/channingwalton/lift_1_1_sample.git run the app up and go to http://localhost:8080/mapSearch and try the search. I find stack overflow in Safari 4.0.2, and Opera 9.64. The query works in Firefox 3.5.2 and Webkit Version 4.0.2 (5530.19, r46770) (latest nightly)

[Lift] Re: New features

2009-08-05 Thread Naftoli Gugenheim
First of all, let me tell you what the error means. It means that there is a relevant row in the join table that doesn't have a corresponding element in the other table. Specifically, calling joinRecord.childMappedForeignKey.obj, so to speak, returns Empty. The question is how it got to this

[Lift] Re: New features

2009-08-05 Thread Naftoli Gugenheim
Oh, I think I know what the problem is. I think I should classify it as a bug. Since you're adding a Role that isn't saved yet, and ManyToMany tracks the children via the join table, it can't access the child. As a workaround save the Role before adding it, although the need to do so is against

[Lift] Re: New features

2009-08-05 Thread glenn
Naftoli, While your working on this issue, there seems to be another. Here's what's happening: If I make a coding mistake, and code User as follows: class User extends MegaProtoUser[User] with ManyToMany[Long,Role]{ def getSingleton = User // what's the meta server object roles

[Lift] Where do I place a default.props file for use by Boot?

2009-08-05 Thread Jeff McKenna
Newbee: I have a default.props file that I was able to read once. I seem to have lost the incantation. Where do I put it. I thought src/resouces would work. But boot can not see to read the file. Any suggestions? --~--~-~--~~~---~--~~ You received this message

[Lift] Re: Where do I place a default.props file for use by Boot?

2009-08-05 Thread Tim Nelson
Try src/main/resources/props On Wed, Aug 5, 2009 at 7:19 PM, Jeff McKenna agile.act...@gmail.com wrote: Newbee: I have a default.props file that I was able to read once. I seem to have lost the incantation. Where do I put it. I thought src/resouces would work. But boot can not see to

[Lift] Re: New features

2009-08-05 Thread Naftoli Gugenheim
Building causes a stack overflow? So the question is, is it the resident compiler or plain scalac also crashes? Or just the presentation compiler? What do you see in the error log view or file? I get compiler crashes very often when doing fancy mapper type related tricks.

[Lift] Re: Where do I place a default.props file for use by Boot?

2009-08-05 Thread Jeff McKenna
Thanks for the suggestion. It seems to have worked. jeff On Aug 5, 5:31 pm, Tim Nelson tnell...@gmail.com wrote: Try src/main/resources/props On Wed, Aug 5, 2009 at 7:19 PM, Jeff McKenna agile.act...@gmail.com wrote: Newbee: I have a default.props file that I was able to read once.  I

[Lift] Alternate part of view

2009-08-05 Thread Naftoli Gugenheim
What's the smartest / most concise way to achieve the following in the corresponding view xhtml and snippet code: Parts of the view have to change, depending on whether something is set. For example, in the area where you select the client, if the client is None, then it displays an interface

[Lift] Re: Exception for S.? while booting

2009-08-05 Thread marius d.
No really. That is for constructing an S object, as it needs the reuest and session object. Lift calls that when processing statefull requests and rendering pieline, bound functions etc. are executed in this context. There is another function S.initIfUninitted where S can be initialized having

[Lift] Re: Alternate part of view

2009-08-05 Thread marius d.
Please see chooseTemplate from Helpers._ (It's actually defined in BindHelpers) For examples see: \sites\example\src\main\webapp\guess.html \sites\example\src\main\scala\net\liftweb\example\snippet \CountGame.scala .. see if that helps you case. Br's, Marius On Aug 6, 6:44 am, Naftoli

[Lift] Re: Alternate part of view

2009-08-05 Thread Naftoli Gugenheim
It doesn't, because it has to replace its contents bound, and the other view part has to be replaced with nothing, so it's less concise than FuncBindParams. - marius d.marius.dan...@gmail.com wrote: Please see chooseTemplate from Helpers._ (It's actually