[Lift] Re: Asynchronous Javascript problem

2009-08-06 Thread Channing Walton
I've added a much simpler example too, see simple.html --~--~-~--~~~---~--~~ 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: More than one lift:surround in HTML file

2009-08-06 Thread pabraham
Thanks everyone. I can get things to work now using lift:with- param ... However, I found a post[1] by DPP that says that lift:with-param ... is deprecated. Is this true? Regards, Paul. [1] http://article.gmane.org/gmane.comp.web.lift/820 On Aug 5, 10:55 pm, Timothy Perrett

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

2009-08-06 Thread pabraham
Firefox 3.5.2 Funnily enough, I can't right click to view source, but Ctrl+U works. The first lines are: ?xml version=1.0 encoding=UTF-8? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns:lift=http://liftweb.net/;

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

2009-08-06 Thread marius d.
On Aug 6, 3:46 pm, pabraham paulabraham...@googlemail.com wrote: Thanks everyone.  I can get things to work now using lift:with- param ... However, I found a post[1] by DPP that says that lift:with-param ... is deprecated.  Is this true? We tried to deprecate it a little while ago but

[Lift] Re: Alternate part of view

2009-08-06 Thread David Pollak
On Wed, Aug 5, 2009 at 8:44 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: 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

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

2009-08-06 Thread David Pollak
On Thu, Aug 6, 2009 at 5:48 AM, marius d. marius.dan...@gmail.com wrote: On Aug 6, 3:46 pm, pabraham paulabraham...@googlemail.com wrote: Thanks everyone. I can get things to work now using lift:with- param ... However, I found a post[1] by DPP that says that lift:with-param ... is

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

2009-08-06 Thread Timothy Perrett
Haha yeah... With-param has had somewhat of a chequered past! Its here to stay for the time being though so don't worry about using it. Cheers, Tim On 06/08/2009 13:48, marius d. marius.dan...@gmail.com wrote: On Aug 6, 3:46 pm, pabraham paulabraham...@googlemail.com wrote: Thanks

[Lift] Re: Title function

2009-08-06 Thread Derek Chen-Becker
Putting it in an object won't work, since you probably want the title to be done per-request. To clarify what I'm saying, here's a small example of how I would set the title for an edit page: First, the template: lift:surround at=content head titlelift:Info.title //title /head

[Lift] IE8 and single-field forms

2009-08-06 Thread Ryan Donahue
Apparently if your form has only one text field (input tag w/ type=text) and one button tag, IE8 does not include the button as a field in the post, but only includes the text field. Here's the IE8 bug report: https://connect.microsoft.com/IE/feedback/ViewFeedback.aspx?FeedbackID=389736 The

[Lift] Re: Alternate part of view

2009-08-06 Thread Naftoli Gugenheim
No, I meant that this pattern of parts of the view being alternatives to each other repeats, in other words the view has several pairs of alternatives. - David Pollakfeeder.of.the.be...@gmail.com wrote: On Wed, Aug 5, 2009 at 8:44 PM, Naftoli Gugenheim

[Lift] Re: Alternate part of view

2009-08-06 Thread David Pollak
I really need to see the resulting view code that you'd like to see depending on the conditions. On Thu, Aug 6, 2009 at 7:47 AM, Naftoli Gugenheim naftoli...@gmail.comwrote: No, I meant that this pattern of parts of the view being alternatives to each other repeats, in other words the view

[Lift] SOAP web services?

2009-08-06 Thread Jacek Furmankiewicz
I was reading through the Lift book PDF and it mentions only REST- style web services. In our case, we need to look at re-implementing a set of existing SOAP web services (is there anything like 'wsdl2scala' anywhere?). I would appreciate any best practices and suggestions for implementing SOAP

[Lift] Re: New features

2009-08-06 Thread glenn
Naftoli, At the risk of discussing something obviously beyond my pay grade, isn't the real issue Scala traits and the use of parameterized types. The ManyToMany trait is defined as: trait ManyToMany[K,T:KeyedMapper[K, T]] But this isn't really correct,is it, the parameter is too broad, and

[Lift] Re: Alternate part of view

2009-08-06 Thread Naftoli Gugenheim
Here's some view xhtml: req:noClient label for=clientqueryClient /label client:query id=clientquery size=5/ client:set / /req:noClient req:client Client client:unset / client:editclient:name //client:editbr / client:details / /req:client hr / And here's some snippet code:

[Lift] Re: New features

2009-08-06 Thread Naftoli Gugenheim
In your use case it can only be Long and User. But there has to be a type parameter because other people might have a String key and a Request mapper. And the contents of ManyToMany have to be type safe to enforce their consistency with however the user of ManyToMany wants them to use it.So I

[Lift] Re: Db.addLogFunc

2009-08-06 Thread marius d.
Yeah we're aware of that. That is based on toString application which is JDBC driver dependent. I think Derek started some work on this to correct this behavior. Derek ? Br's, Marius On Aug 6, 8:01 pm, jon jonhoff...@gmail.com wrote: Hi, I have the following in boot:  

[Lift] Re: New features

2009-08-06 Thread glenn
Naftoli, As I said at the outset, this is really beyond my expertise. But I think it's too broad and maybe, even unnecessary. In my example, K can only be one type, Long, and T can only be of type User. Anything else, and the compiler can't be guaranteed to catch it, but try running the

[Lift] Re: Title function

2009-08-06 Thread Naftoli Gugenheim
Are you showing me a way for Title to access this information? In this case Info is the original snippet class? Is this a way to access Info.title outside of the instance of Info? What would be ideal, at least in a certain sense, is if there would be some way for the Loc to access the snippet

[Lift] How do I create a function that takes MetaMappers?

2009-08-06 Thread jon
I'd like to do something like def findAll[T : LongKeyedMapper[T],M : LongKeyedMetaMapper[T]] (metaObject: M): List[T] = { metaObject.findAll } val users:List[User] = findAll(User) val foos:List[Foo] = findAll(Foo) But the compiler won't have it.

[Lift] Re: Db.addLogFunc

2009-08-06 Thread Derek Chen-Becker
Well, I started looking at it and determined that the only way for us to truly log the queries would be to essentially make our own wrappers over Statement and PreparedStatement. There are projects (log4jdbc, notably) that already do this, and in a transparent manner. I'm not sure that adding a

[Lift] Re: SOAP web services?

2009-08-06 Thread Derek Chen-Becker
As far as I know there aren't any Scala-specific SOAP libs, so it's probably simplest to use on of the Java ones to create the stubs and then just use those from Scala. If I'm wrong and there are some Scala SOAP libs out there, I'd love to know about them. Derek On Thu, Aug 6, 2009 at 9:26 AM,

[Lift] Re: How do I create a function that takes MetaMappers?

2009-08-06 Thread Ross Mellgren
What complaint does the compiler have? -Ross On Aug 6, 2009, at 2:06 PM, jon wrote: I'd like to do something like def findAll[T : LongKeyedMapper[T],M : LongKeyedMetaMapper[T]] (metaObject: M): List[T] = { metaObject.findAll } val users:List[User] = findAll(User)

[Lift] Re: Db.addLogFunc

2009-08-06 Thread marius d.
Probably building our own wrappers would be more lightweight then 3-rd party. Jus' guessing Br's, Marius On Aug 6, 9:58 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: Well, I started looking at it and determined that the only way for us to truly log the queries would be to essentially

[Lift] Re: How do I create a function that takes MetaMappers?

2009-08-06 Thread Naftoli Gugenheim
Pull M out as a type parameter and just declare the value parameter to be whatever M means. - Ross Mellgrendri...@gmail.com wrote: What complaint does the compiler have? -Ross On Aug 6, 2009, at 2:06 PM, jon wrote: I'd like to do something like

[Lift] SiteMap gives No Navigation Defined.

2009-08-06 Thread pabraham
Hello there, I've been looking at SiteMap and trying to get it to give me a page title, based on the SiteMap section in the Lift book (PDF version). Here's how I've tried. Boot.scala // Build SiteMap val entries = Menu(Loc(Home, index::Nil, Home)) :: Nil

[Lift] Re: How do I create a function that takes MetaMappers?

2009-08-06 Thread jon
val users:List[User] = findAll(User) -- inferred type arguments [Nothing,object com.x.lift.model.User] do not conform to method findAll's type parameter bounds [T : net.liftweb.mapper.LongKeyedMapper[T],M : net.liftweb.mapper.LongKeyedMetaMapper[T]] if i change to: val users:List[User] =

[Lift] Re: SiteMap gives No Navigation Defined.

2009-08-06 Thread Naftoli Gugenheim
Not sure why you're getting no nav, but I think you want to change the other Home - the first string is the id of the link. - pabrahampaulabraham...@googlemail.com wrote: Hello there, I've been looking at SiteMap and trying to get it to give me a page

[Lift] Re: How do I create a function that takes MetaMappers?

2009-08-06 Thread jon
Thanks Naftoli, is this what you mean? def findAll[T : LongKeyedMapper[T]] (metaObject: LongKeyedMetaMapper[T]): List[T] = { metaObject.findAll } **val users:List[User] = findAll[User](User) still get **- type arguments [com.udorse.lift.model.User] do not conform to

[Lift] Re: How do I create a function that takes MetaMappers?

2009-08-06 Thread Ross Mellgren
Naftoli's suggestion is good, but I think your problem now is that User is not : LongKeyedMapper, it's : KeyedMapper. Here's one that compiles: object Test { def findAll[T](m: KeyedMetaMapper[_, T]) = m.findAll def test { val users: List[User] = findAll(User)

[Lift] Re: SiteMap gives No Navigation Defined.

2009-08-06 Thread pabraham
Same thing happens, i.e. I get No Navigation Defined. and no title. On 6 Aug, 20:38, Naftoli Gugenheim naftoli...@gmail.com wrote: Not sure why you're getting no nav, but I think you want to change the other Home - the first string is the id of the link.

[Lift] Re: SiteMap gives No Navigation Defined.

2009-08-06 Thread TylerWeir
No Nav Defined typically shows up for me, when I've got my DB connection messed up. On Aug 6, 3:51 pm, pabraham paulabraham...@googlemail.com wrote: Same thing happens, i.e. I get No Navigation Defined. and no title. On 6 Aug, 20:38, Naftoli Gugenheim naftoli...@gmail.com wrote: Not

[Lift] Rendering dynamic templates

2009-08-06 Thread fbettag
Hi there, i was just wondering how one would go about dynamifying templates? Atm i store them on disk. Is there any way to parse a template and execute all the lift:MyStuff in that template? Like Xml.load but the way lift does it to render stuff in it. I tried to find it in code but didn't

[Lift] Re: SiteMap gives No Navigation Defined.

2009-08-06 Thread pabraham
Actually, same thing doesn't happen. If I change the third argument, I get this as the title in my browser as well as the link in the site map. On 6 Aug, 20:51, pabraham paulabraham...@googlemail.com wrote: Same thing happens, i.e. I get No Navigation Defined. and no title. On 6 Aug, 20:38,

[Lift] Re: Rendering dynamic templates

2009-08-06 Thread marius d.
Please see LiftSession.processSurroundAndInclude ... I wouldn't recommend processing templates outside normal rendering pipeline ... but for specific cases it might be ok. But what is your use case? Br's, Marius On Aug 6, 11:12 pm, fbettag fr...@bett.ag wrote: Hi there, i was just

[Lift] Re: Eclipse setup

2009-08-06 Thread Steffen Weißmann
You have two output folders: the Scala IDE = 2.7.5.final only supports one. Use a single default output folder. That helped somehow, at least in the Boot.scala file it was pretty much ok. But the other files were no better. For instance, clicking on MetaProtoUser still opens Object.java

[Lift] Re: Db.addLogFunc

2009-08-06 Thread Derek Chen-Becker
If there's a consensus that we want our own JDBC wrappers I'll go ahead and write them. Derek On Thu, Aug 6, 2009 at 1:19 PM, marius d. marius.dan...@gmail.com wrote: Probably building our own wrappers would be more lightweight then 3-rd party. Jus' guessing Br's, Marius On Aug 6, 9:58

[Lift] Re: Eclipse setup

2009-08-06 Thread Miles Sabin
On Thu, Aug 6, 2009 at 9:44 PM, Steffen Weißmannsteffen.weissm...@googlemail.com wrote: I guess several people are developing lift projects with eclipse, so I hope there is a chance to get it working. Is there any configuration (Eclipse version+plugin versions+project setup) that is known to

[Lift] Re: SiteMap gives No Navigation Defined.

2009-08-06 Thread Derek Chen-Becker
So it's working correctly, or it's still broken? same thing doesn't happen is a bit unclear ;) Derek On Thu, Aug 6, 2009 at 1:56 PM, pabraham paulabraham...@googlemail.comwrote: Actually, same thing doesn't happen. If I change the third argument, I get this as the title in my browser as

[Lift] Re: Rendering dynamic templates

2009-08-06 Thread Derek Chen-Becker
It might be nice to make template loading configurable. Currently, TemplateFinder is used to load templates and it, in turn, uses LiftRules.finder to locate a resource by name from the classloader. I think that we could add a layer of indirection there to allow someone to use a partial function to

[Lift] Re: Rendering dynamic templates

2009-08-06 Thread fbettag
The CMS is my exactly my usecase. I'll try my luck with processSurroundAndInclude. On Aug 6, 11:07 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: It might be nice to make template loading configurable. Currently, TemplateFinder is used to load templates and it, in turn, uses

[Lift] StatefulSnippet link and functionMap

2009-08-06 Thread glenn
I have a stateful snippet with multiple StatefulSnippet links in the bind helper. Clicking on each link gives me a 403 error. I noticed that the function map for each link is different. Shouldn't they be the same, since I'm trying to reload the same page as the one the link is on? Glenn...

[Lift] Re: Rendering dynamic templates

2009-08-06 Thread fbettag
marius, do you have any idea what i could pass lift:surround's with= attribute? On Aug 6, 11:31 pm, fbettag fr...@bett.ag wrote: The CMS is my exactly my usecase. I'll try my luck with processSurroundAndInclude. On Aug 6, 11:07 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: It might

[Lift] Re: StatefulSnippet link and functionMap

2009-08-06 Thread Naftoli Gugenheim
No, because links have associated functions. - glenngl...@exmbly.com wrote: I have a stateful snippet with multiple StatefulSnippet links in the bind helper. Clicking on each link gives me a 403 error. I noticed that the function map for each link is

[Lift] Re: Eclipse setup

2009-08-06 Thread Jonathan A Ferguson
See if the following configuration helps you as it solved most of my problems. http://blog.spiralarm.com/richard/2009/07/using-existing-scala-maven-project-in.html Cheers Jono On 07/08/2009, at 6:44 AM, Steffen Weißmann wrote: You have two output folders: the Scala IDE =

[Lift] Re: Rendering dynamic templates

2009-08-06 Thread fbettag
def render(inContentid: String): LiftResponse = { val content = Content.find(By(Content.id, inContentid.toLong)) match { case Full(obj) = obj case _ = return NotFoundResponse() } val layout =

[Lift] Re: Rendering dynamic templates

2009-08-06 Thread fbettag
gnaa, i had a caching problem with this one.. the problem is the first argument to processSurroundAndInclude.. still.. ;) On Aug 7, 12:47 am, fbettag fr...@bett.ag wrote:         def render(inContentid: String): LiftResponse = {                 val content = Content.find(By(Content.id,

[Lift] amqp library error

2009-08-06 Thread ph
I'm trying to use lift-amqp library, so I created a maven test project (not Lift one, but just Scala with dependency to lift). I'm using Eclipse with maven-scala-plugin on Windows. I'm using almost exact copy of ExampleStringAMQPSender and ExampleStringAMQPListener. And it behaves very weird:

[Lift] Re: amqp library error

2009-08-06 Thread Timothy Perrett
I wrote a fairly extensive blog about how to use the AMQP module - please take a read of it and watch the video: http://is.gd/CkPX - my example is also not a webapp, so its just what you want! The source code is also available which should help you. Cheers, Tim On 06/08/2009 23:55, ph

[Lift] Re: SOAP web services?

2009-08-06 Thread Timothy Perrett
Myself and Viktor are two committers who do a lot of SOAP work - right now, the best route forward it to use the Java JAX-WS code and call into it with a scala wrapper - this is exactly what I do and it works perfectly. Because there is toll free calling of Java code, there is little point in

[Lift] Re: How do I create a function that takes MetaMappers?

2009-08-06 Thread jon
excellent! thank you both. - jon On Aug 6, 3:47 pm, Ross Mellgren dri...@gmail.com wrote: Naftoli's suggestion is good, but I think your problem now is that   User is not : LongKeyedMapper, it's : KeyedMapper. Here's one that   compiles: object Test {      def findAll[T](m:

[Lift] Re: Rendering dynamic templates

2009-08-06 Thread fbettag
Ok the problem is in src/main/scala/net/liftweb/bultin/snippet/ Surround.scala line 36: #36 ctx.findAndMerge(S.attr.~(with), paramsMap) Here is the function which clearly needs a file to work with. u'll do the bind by hand. private[liftweb] def findAndMerge(templateName: Box[Seq[Node]],

[Lift] Re: Eclipse setup

2009-08-06 Thread jon
I've found that simply closing all the open files and re-opening fixes some quirks. I'm using eclipse 3.5, IAM .10, scala 2.7.5, and javarebel-plugin 1.0.3 with javarebel 2.0.2b Is anyone else using javarebel with eclipse? I just run RunWebApp as a scala Application from within eclipse with

[Lift] Re: Rendering dynamic templates

2009-08-06 Thread fbettag
Yeah, finally i am getting better at finding this stuff out myself ;) The dirty solution is to create an empty file named empty.html templates-hidden and use this bind: val res = sess.processSurroundAndInclude( empty, bind(lift,

[Lift] Re: Rendering dynamic templates

2009-08-06 Thread David Pollak
First, you can associate a default template with a given Loc in SiteMap view the Loc.Template mechanism. Second, you can register a partial function with LiftRules.viewDispatch to render whatever dynamic content you want. Third (and this is the recommended solution for a CMS), you can use a

[Lift] Custom Login

2009-08-06 Thread turp1twin
I am new to Lift and have a newbie question. I have searched the group and have not really found an answer to my question. I was hoping for some pointers on implementing custom Login logic. I am currently looking at the MetaMegaProtoUser code and am trying sort out what I will need. I have no

[Lift] Re: SiteMap gives No Navigation Defined.

2009-08-06 Thread David Pollak
Please look at the console output. If there's a stack trace generated during the execution of Boot.scala, your app will be in an undefined state and that may include the lack of a menu and/or title. On Thu, Aug 6, 2009 at 12:56 PM, pabraham paulabraham...@googlemail.comwrote: Actually, same

[Lift] Re: Custom Login

2009-08-06 Thread David Pollak
I think you could remove the User class/object pair from the app and replace them with: object LoginState { object primaryKey extends SessionVar[Box[Long]](Empty) // the primary key of the currently logged in user... change to Box[String] if the PK is a String object currentUser extends

[Lift] Re: New features

2009-08-06 Thread David Pollak
There are dependent types that mirror the parameterized types for Mapper, KeyedMapper, etc. I've updated ManyToMany to use the dependent types... it should eliminate the need to have the type parameters. If it breaks thing, please revert the changes. On Thu, Aug 6, 2009 at 9:55 AM, Naftoli