[Lift] Re: lift views
Yoryos, You probably missed the part where you can add a head element inside the surround tags and it will replace the default element: lift:surround with=default2 at=content head titleA better title than the one in default.html/title /head h2Welcome to your project!/h2 plift:helloWorld.howdy //p /lift:surround I don't see that duplicating the html and body tags unnecessarily makes it any better. Just adds clutter, IMO. The fewer tags I have to deal with, the easier it is to read. Chas. valotas wrote: Hi all! Just a proposal: wouldn't be better to have the views look like more an html page. I mean for the basic project created, instead of having an index.html look like lift:surround with=default2 at=content h2Welcome to your project!/h2 plift:helloWorld.howdy //p /lift:surround have something like: html lift:surround with=default2 at=content head titleA better title than the one in default.html/title /head body h2Welcome to your project!/h2 plift:helloWorld.howdy //p /body /lift:surround /html Yes we have more boilerplate code but with that way it would be much more easier the edditing of the page. Yoryos --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Lift does not display templates as described in the book.
Try posting your conceptual questions to the list. Maybe folks here can help, and once we understand what you need, we can look into providing some documentation to support it. No book can fill all needs. Lots of people just want clear examples and can go from there. The Lift book addresses that need very well, I think. But hopefully we'll have more Lift books soon, each taking a slightly different approach to learning Lift. I'd love to contribute to one, but I'm still trying to learn Lift myself. Specific suggestions always welcome. Chas. Sean Reque wrote: Concrete examples are a great teaching tool, but unless you eventually teach the concepts behind the examples, your students are incapable of applying their knowledge to do anything beyond what they can glean from the examples example. It's like teaching math purely through example with no theory: your students may be able to pass your tests, but they won't understand what they are doing and come next year they won't be able to build on what they learned. I'm finding the lift book sorely lacking in teaching concepts, and because of that I'm having an all but impossible time learning what is actually possible in lift. I I am not the kind of programmer that just copies and pastes other peoples' examples. I want to understand my tool and use it to it's fullest potential. When the lift book describes how pages are rendered, as if teaching a concept, and leaves out essential details like what scope templates are actually searched in, how am I supposed to understand how Lift works without posting to this mailing list or reading the source code? I wasted a couple of hours reducing my problem down to the simplest test case, and this is not the first time since learning lift where I've wasted so much time only to learn that either something doesn't work or doesn't work the way I thought. I'm pretty sure that had I picked rails or django for my pet project I would have been done already. Is it simply that Lift is too cutting edge for me? Am I the only one wasting hours of time learning how Lift and other Java tools work rather than getting my app written? I'm sorry if I sound frustrated. It is not just Lift I am struggling with. It's the whole stack I'm trying to learn! I am just getting immersed into the Java world again during my spare time. JAXB (especially JAXB!), buildr/maven/ant, Jetty, Scala and it's Eclipse plugin, Lift, each one of these tools has taken up hours of my time as I struggle to do what I thought I could do easily by reading about the tool or reading the tool's documentation. I am grateful for your response though and will take time to learn more about what the sitemap means in Lift. - Sean Reque On May 30, 2:56 pm, marius d. marius.dan...@gmail.com wrote: To access a page you need to add it in the SiteMap. I assume you are a bit confused about the relation between a Menu and a page. I mean after all maybe for your site you don't really need a menu but in Lift a Menu is much more then a visual representation of a way to navigate to your pages. It specifies various things such as how to access a page (constraints definition), visibility of a page in the sitemap Menu etc. So in short the SiteMap + Menu + Loc describes how pages can be accesses in a Lift app. The Lift book describes that by the means of concrete examples, detailed Menu Loc descriptions etc. Maybe some things in the book are not very obvious for a first read or just reading it as ultimatelly learning Lift is about coding trying things. The book is just a mean to an end, I would say. Br's, Marius On May 30, 9:38 pm, Sean Reque seanre...@gmail.com wrote: I have the pocketchange app with lift 1.0. I add a directory in webapp with an index.html file, identical to the help directory except with some changed text. I visit the URL corresponding to the directory and it doesn't show up at all, but tells me the requested resource is not found. I then add the directory index.html file to the global sitemap in Boot.scala the same as it's help counterpart, recompile and restart jetty, and suddenly, without even using or touching the sitemap, lift displays the processed template. I've read the template finding algorithm described in the exploring lift book and it makes no mention of any such requirement, and I'm pretty sure I shouldn't have to add every single template file to the global sitemap to get lift to even recognize it's existence. What important detail am I missing? --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Where is scalajpa.jar?
Nope, it's in there. Thanks. 刘浩 wrote: I think you need to add snapshots repository in your pom.xml repositories repository idscala-tools.org http://scala-tools.org/id nameScala-Tools Maven2 Repository/name urlhttp://scala-tools.org/repo-releases/url /repository repository idscala-tools.org.snapshots/id nameScala-Tools Maven2 Repository for Snapshots/name urlhttp://scala-tools.org/repo-snapshots/url snapshots/ /repository /repositories 2009/5/31 Bryan. germ...@gmail.com mailto:germ...@gmail.com http://scala-tools.org/repo-snapshots/org/scala-tools/scalajpa/ --Bryan --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Where is scalajpa.jar?
Nope. Now it just can't find the lift-jpa jar. Thanks. Chas. Atsuhiko Yamanaka wrote: Hi, On Sun, May 31, 2009 at 9:37 AM, c...@munat.com wrote: Missing: -- 1) org.scala-libs:scalajpa:jar:1.1-SNAPSHOT Instead of the artifactId for scalajpa, I think that problem will be resolved by adding following tag, dependency groupIdnet.liftweb/groupId artifactIdlift-jpa/artifactId version1.1-SNAPSHOT/version /dependency The 'scalajpa.jar' will be retrieved via lift-jpa. Sincerely, -- Atsuhiko Yamanaka JCraft,Inc. 1-14-20 HONCHO AOBA-KU, SENDAI, MIYAGI 980-0014 Japan. Tel +81-22-723-2150 +1-415-578-3454 Fax +81-22-224-8773 Skype callto://jcraft/ --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: JavaScript interface to Comet
Yes looks like this is exactly what you would need. Please see partialUpdate from CometActor. As an example you can see sites/example/ src/main/scala/net/liftweb/example/comet/Clock.scala. partialUPdate function returns a JsCmd but there are of course implicit conversions between JsExp and JsCmd. What you're trying to do seems like an interesting thing for a Lift demo app in the sense that it would provide an interesting visual effect through CometActor. Br's, Marius On May 31, 4:46 am, Xavi Ramirez xavi@gmail.com wrote: I'm trying add some comet features to an existing JS app. Essentially, I want to drag/drop a widget and have my movements reflected on other user's browsers. You mentioned that a CometActor can cause JsExp to be executed. This might be what I'm looking for. How does that work? Thanks, Xavi On Sat, May 30, 2009 at 5:02 PM, marius d. marius.dan...@gmail.com wrote: Lift generates the JavaScript for Comet so you essentially don't have to worry about it. From a CometActor you just provide the markup that you need to render asynchronously or just the JsExp to be executed by browser. However could you please provide an overview of what you're trying to achieve? P.S. By default Lift's Ajax/Comet support works against JavaScript content type responses and not JSON. However you can use JSON as well. Br's, Marius On May 30, 3:12 pm, Xavi Ramirez xavi@gmail.com wrote: Hello, I was wondering if Lift provides a javascript interface to comet? Ideally it would look something like this: lift.getComet(comet-name).addListener(callback); // callback takes a json object lift.getComet(comet-name).postMessage(jsonObj); Thanks, Xavi --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Showing a Box or Redirecting?
class SomeSnippet { val foo: Box[Foo] = tryo(session1.get(S.param(id).getOrElse ())) // But I think with this code you'll always get a Full Box due to getOrElse ? def render(func: foo = NodeSeq) = foo.map(l = func(l)) openOr (your code in case foo is empty and potentially return NodeSeq.Empty) def showA(xhtml: NodeSeq): NodeSeq = render { myFoo = ... } def showB(xhtml: NodeSeq): NodeSeq = render { myFoo = ... }. def showC(xhtml: NodeSeq): NodeSeq = render { myFoo = ... } def showD(xhtml: NodeSeq): NodeSeq = render { myFoo = ... } def showE(xhtml: NodeSeq): NodeSeq = render { myFoo = ... } } On May 31, 4:40 am, Bryan. germ...@gmail.com wrote: I guess I should just have def showFoo(xhtml: NodeSeq) and use bind to render A, B, C, D, and E. --Bryan On May 30, 9:12 pm, Bryan germ...@gmail.com wrote: If Foo has 5 methods that I need to show in a Snippet (scattered throughout the template), what's a good way to S.error(inactive); S.redirectTo(/) whenever Box[Foo] cannot be opened because it is not Full, without having to write a bunch of boiler plate code for each of the show methods I have defined below. class SomeSnippet { val foo: Box[Foo] = tryo(session1.get(S.param(id).getOrElse())) def showA(xhtml: NodeSeq): NodeSeq = ... def showB(xhtml: NodeSeq): NodeSeq = ... def showC(xhtml: NodeSeq): NodeSeq = ... def showD(xhtml: NodeSeq): NodeSeq = ... def showE(xhtml: NodeSeq): NodeSeq = ... } Thanks, Bryan --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Ideas for an ordered list in a form
A couple of years ago I did the same thing with drag and drop ... but I wrote the JS code, and for some reason I didn't really look for an existent solution :) ... I think I still have the damn thing and if you want to I could send it to you. On May 31, 3:01 am, Derek Chen-Becker dchenbec...@gmail.com wrote: I have some ideas for this, but my short term solution is to make a Lift version of Palette. Once I have it debugged I'll add it as a widget. Derek On Sat, May 30, 2009 at 3:17 AM, Joe Wass j...@folktunefinder.com wrote: Bump. I'm interested in this too. On May 28, 10:01 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: Oops. I meant to give the link to Tapestry so that people could see what I'm talking about (image toward the middle of the page): http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tap... Derek On Thu, May 28, 2009 at 3:00 PM, Derek Chen-Becker dchenbec...@gmail.comwrote: I'd like to pick everyone's brains on a small requirement I have for an in-house app. I need to have the end-user select a subset of items from a master set. Additionally, the items should be ordered. Typically in the past I've used something like Tapestry's Palette control (or rolled my own with some selects and javascript). I don't think that this would be too hard to do in Lift, but I was wondering if anyone else has a better approach that they've used or seen in use. Thanks, Derek --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: lift views
Agreed with Tim. I also don't see any value. And the point of viewing the template statically is not an argument to me because the template is still incomplete for a proper rendering, xhtml browser would probably complain about prefixes it doesn't know about etc. Br's, Marius On May 31, 5:32 am, Xavi Ramirez xavi@gmail.com wrote: The value is that Yoryos version is a valid HTML page and can be easily viewed without having lift/jetty running. This could be handy for designs, for example. I'm personally not 100% sold (I hate boilerplate), but it's an interesting idea. -Xavi On Sat, May 30, 2009 at 7:44 PM, Timothy Perrett timo...@getintheloop.eu wrote: There really is no benifit in this IMO - the only difference is that you have more redundant code? You can set the head from any page file like so: lift:surround with=default at=content head titlemy lovely title/title /head h2Welcome to your project!/h2 plift:helloWorld.howdy //p /lift:surround Lift automatically consolidates the head elements into a single one before presenting the resulting html output to the browser. Other than that, your proposistion adds no value right? Its still well formed xml with a single node, it just happens to be that your is html. Do note however, that if you really wanted to use your way, then lift would not get in your way Cheers, Tim On May 30, 10:57 pm, valotas valo...@gmail.com wrote: Hi all! Just a proposal: wouldn't be better to have the views look like more an html page. I mean for the basic project created, instead of having an index.html look like lift:surround with=default2 at=content h2Welcome to your project!/h2 plift:helloWorld.howdy //p /lift:surround have something like: html lift:surround with=default2 at=content head titleA better title than the one in default.html/title /head body h2Welcome to your project!/h2 plift:helloWorld.howdy //p /body /lift:surround /html Yes we have more boilerplate code but with that way it would be much more easier the edditing of the page. Yoryos --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Where is scalajpa.jar?
I just checked repository. I think no 1.1-SNAPSHOT for scalajpa. Only 1.0-SNAPSHOT their. That should be the problem. 2009/5/31 Charles F. Munat c...@munat.com Nope. Now it just can't find the lift-jpa jar. Thanks. Chas. Atsuhiko Yamanaka wrote: Hi, On Sun, May 31, 2009 at 9:37 AM, c...@munat.com wrote: Missing: -- 1) org.scala-libs:scalajpa:jar:1.1-SNAPSHOT Instead of the artifactId for scalajpa, I think that problem will be resolved by adding following tag, dependency groupIdnet.liftweb/groupId artifactIdlift-jpa/artifactId version1.1-SNAPSHOT/version /dependency The 'scalajpa.jar' will be retrieved via lift-jpa. Sincerely, -- Atsuhiko Yamanaka JCraft,Inc. 1-14-20 HONCHO AOBA-KU, SENDAI, MIYAGI 980-0014 Japan. Tel +81-22-723-2150 +1-415-578-3454 Fax +81-22-224-8773 Skype callto://jcraft/ --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Where is scalajpa.jar?
And also a thread scalajpa 1.1 you could follow. http://groups.google.com/group/liftweb/browse_thread/thread/3dc4c71216a24e6c?pli=1 2009/5/31 刘浩 sniperliu...@gmail.com I just checked repository. I think no 1.1-SNAPSHOT for scalajpa. Only 1.0-SNAPSHOT their. That should be the problem. 2009/5/31 Charles F. Munat c...@munat.com --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: lift views
Now you mention it though, it might well work quite nicely. Talk to me Viktor - what are you thinking? Cheers, Tim On 31/05/2009 14:10, Viktor Klang viktor.kl...@gmail.com wrote: Couldn't they just define an XSLT template to view the lift templates with? --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Where is scalajpa.jar?
That helped. Thanks. 刘浩 wrote: And also a thread scalajpa 1.1 you could follow. http://groups.google.com/group/liftweb/browse_thread/thread/3dc4c71216a24e6c?pli=1 2009/5/31 刘浩 sniperliu...@gmail.com mailto:sniperliu...@gmail.com I just checked repository. I think no 1.1-SNAPSHOT for scalajpa. Only 1.0-SNAPSHOT their. That should be the problem. 2009/5/31 Charles F. Munat c...@munat.com mailto:c...@munat.com --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Vscaladoc not grokking new documentation
No, because they're intended to be formatting for the Scaladoc. Note that I escape entities within the table that should be displayed. Derek On Sat, May 30, 2009 at 9:38 AM, Timothy Perrett timo...@getintheloop.euwrote: Just an off the wall shot, but do the entities have to be encoded? E.g. lt; and gt; Thanks, Tim On 29/05/2009 20:13, Derek Chen-Becker dchenbec...@gmail.com wrote: I've been adding a lot of expanded documentation to S and I just noticed that there are whole sections that are disappearing. For instance, I provided the following scaladoc for S.attrs: /** * pGet a list of current attributes. Each attribute item is a pair of (key,value). The key * is an Either that depends on whether the attribute is prefixed or not. If the attribute * is prefixed, the key is a Right((prefix, name)). If the attribute is unprefixed then the * key is a Left(name). For example, the following table shows how various tag attributes * would be represented:/p * * table * tr * tdlt;lift:MySnippet testname=test /gt;/td * tdList((Left(testname), test))/td * /tr * tr * tdlt;lift:MySnippet anchor:name=test /gt;/td * tdList((Right((anchor, name)), test))/td * /tr * /table * * pThe prefixedAttrsToMap method provides a convenient way to retrieve only attributes with * a given prefix. The prefixedAttrsToMetaData method can be used to add attributes onto an XML * node/p * * @see #prefixedAttrsToMap(String) * @see #prefixedAttrsToMap(String,Map) * @see #prefixedAttrsToMetaData(String) * @see #prefixedAttrsToMetaData(String,Map) */ But the generated documentation for this method is completely empty after the first sentence: http://scala-tools.org/mvnsites-snapshots/liftweb/lift-webkit/scaladocs/index . html Is this a bug or am I writing something wrong in the above comment? Thanks, Derek --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Vscaladoc not grokking new documentation
Try shooting David B a mail offline he¹s the vscaladoc master Not sure that he watches the lift list too much these days. Having said that I¹ve not seen him on Gtalk for sometime so not sure what his movements are. Cheers, Tim On 31/05/2009 22:50, Derek Chen-Becker dchenbec...@gmail.com wrote: No, because they're intended to be formatting for the Scaladoc. Note that I escape entities within the table that should be displayed. --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Continued problems with JPA archetypes
The velocity warnings are normal. What you're seeing may be a bug. I haven't tested the archetype since the change to 2.7.4, so it may be related. I'll test it out this week. Derek On Sat, May 30, 2009 at 6:38 PM, c...@munat.com wrote: I tried again, running this: mvn archetype:generate \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-jpa-basic \ -DarchetypeVersion=1.1-SNAPSHOT \ -DgroupId=com.xxx -DartifactId=xxx-master I then did a cd to xxx-master and ran mvn compile. I got this: mvn compile [15:06] [INFO] Scanning for projects... [INFO] Reactor build order: [INFO] xxx-master Master [INFO] xxx-master-spa [INFO] xxx-master-web [INFO] [INFO] Building xxx-master Master [INFO]task-segment: [compile] [INFO] Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.7.4/scala-compiler-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.7.4/scala-library-2.7.4.pom Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom 1Khttp://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.pom%0A1Kdownloaded Downloading: http://scala-tools.org/repo-snapshots/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar Downloading: http://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar 2389Khttp://repo1.maven.org/maven2/org/apache/derby/derby/10.4.2.0/derby-10.4.2.0.jar%0A2389Kdownloaded [INFO] [scala:compile {execution: default}] [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /private/var/www/xxx-master/src/main/scala [ERROR] /private/var/www/xxx-master/src/main/scala/../scala [WARNING] No source files found. [INFO] [INFO] Building xxx-master-spa [INFO]task-segment: [compile] [INFO] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [scala:compile {execution: default}] [INFO] suggestion: remove the scalaVersion from pom.xml [ERROR] /private/var/www/xxx-master/spa/src/main/scala [ERROR] /private/var/www/xxx-master/spa/src/main/scala/../scala [INFO] Compiling 9 source files to /private/var/www/xxx-master/spa/target/classes [WARNING] /private/var/www/xxx-master/spa/src/main/scala/com/xxx/model/EnumvType.scala:48: error: value valueOf is not a member of Enumeration with com.xxx.model.Enumv [WARNING] return et.valueOf(value).getOrElse(null) [WARNING] ^ [WARNING] one error found [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] command line returned non-zero value:1 [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 2 minutes 34 seconds [INFO] Finished at: Sat May 30 15:19:22 PDT 2009 [INFO] Final Memory: 7M/14M [INFO] I've changed nothing. Am I doing something wrong or is there a bug? Could part of the problem be the warnings below, which came up during generation of the app? [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 37,column 16] : ${scala.version} is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 43,column 16] : ${scala.version} is not a valid reference. [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 85,column 25] : ${scala.version} is not a valid reference. [WARNING] PT Don't override file /private/var/www/xxx-master/pom.xml [WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/web/pom.xml [line 13,column 9] : ${parent.artifactId} is not a valid reference. [WARNING]
[Lift] Re: Where is scalajpa.jar?
Hi, On Sun, May 31, 2009 at 4:30 PM, Charles F. Munat c...@munat.com wrote: Nope. Now it just can't find the lift-jpa jar. Liftweb project recommends to use 'lift-jpa'. Refer to the content of its pom file[1]. scalajpa.jar 1.1 will be downloaded from http://scala-tools.org/repo-releases/org/scala-libs/scalajpa/1.1/ [1] http://scala-tools.org/repo-snapshots/net/liftweb/lift-jpa/1.1-SNAPSHOT/lift-jpa-1.1-SNAPSHOT.pom Sincerely, -- Atsuhiko Yamanaka JCraft,Inc. 1-14-20 HONCHO AOBA-KU, SENDAI, MIYAGI 980-0014 Japan. Tel +81-22-723-2150 +1-415-578-3454 Fax +81-22-224-8773 Skype callto://jcraft/ --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Ideas for an ordered list in a form
If it's not too much trouble to find that would be great, but don't work too hard searching : Derek On Sun, May 31, 2009 at 2:59 AM, marius d. marius.dan...@gmail.com wrote: A couple of years ago I did the same thing with drag and drop ... but I wrote the JS code, and for some reason I didn't really look for an existent solution :) ... I think I still have the damn thing and if you want to I could send it to you. On May 31, 3:01 am, Derek Chen-Becker dchenbec...@gmail.com wrote: I have some ideas for this, but my short term solution is to make a Lift version of Palette. Once I have it debugged I'll add it as a widget. Derek On Sat, May 30, 2009 at 3:17 AM, Joe Wass j...@folktunefinder.com wrote: Bump. I'm interested in this too. On May 28, 10:01 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: Oops. I meant to give the link to Tapestry so that people could see what I'm talking about (image toward the middle of the page): http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tap... Derek On Thu, May 28, 2009 at 3:00 PM, Derek Chen-Becker dchenbec...@gmail.comwrote: I'd like to pick everyone's brains on a small requirement I have for an in-house app. I need to have the end-user select a subset of items from a master set. Additionally, the items should be ordered. Typically in the past I've used something like Tapestry's Palette control (or rolled my own with some selects and javascript). I don't think that this would be too hard to do in Lift, but I was wondering if anyone else has a better approach that they've used or seen in use. Thanks, Derek --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Strange behavior of RequestVar
Compare two cases. First: class SnippetName { object oVar extends RequestVar(O.create) def processAdd(o: O) { ... } def add(xml: NodeSeq): NodeSeq = { bind (f, xml, field - SHtml.text(oVar.is.field, oVar.is.field(_)), submit - SHtml.submit(Submit, () = processAdd(oVar.is) ) } } And the second case: class SnippetName { object oVar extends RequestVar(O.create) def processAdd(o: O) { ... } def add(xml: NodeSeq): NodeSeq = { val o = oVar.is // CHANGES STARTS HERE bind (f, xml, field - SHtml.text(o.field, o.field(_)), submit - SHtml.submit(Submit, () = processAdd(o) ) } } In firts case all works fine, but in second case data not retained across submit trying. Why? --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: lift views
No! I didn't missed that part. Like Xavi said the benefit is a valid html page. It would be much more intresting having something like html xmlns=http://www.w3.org/1999/xhtml; xmlns:lift=http:// liftweb.net/ head!-- I don't not if it's valid to just not even have a head tag when we don't want to --/head body lift:layout=default lift:name=content h2Welcome to your project!/h2 plift:helloWorld.howdy //p /body /html witch has less boilerplate (than my first example) and is very easy IMHO to understand and read. I'm very new to lift and I just think that telling something that would look easier to me, would also look easier to any newby. At the other hand, being newby also means that I don't have a good overview of the framework and it's design. It is better thought to say something event if it is wrong before you get used to it, because then you'll just get used to it!! Yoryos On May 31, 1:53 am, Charles F. Munat c...@munat.com wrote: Yoryos, You probably missed the part where you can add a head element inside the surround tags and it will replace the default element: lift:surround with=default2 at=content head titleA better title than the one in default.html/title /head h2Welcome to your project!/h2 plift:helloWorld.howdy //p /lift:surround I don't see that duplicating the html and body tags unnecessarily makes it any better. Just adds clutter, IMO. The fewer tags I have to deal with, the easier it is to read. Chas. valotas wrote: Hi all! Just a proposal: wouldn't be better to have the views look like more an html page. I mean for the basic project created, instead of having an index.html look like lift:surround with=default2 at=content h2Welcome to your project!/h2 plift:helloWorld.howdy //p /lift:surround have something like: html lift:surround with=default2 at=content head titleA better title than the one in default.html/title /head body h2Welcome to your project!/h2 plift:helloWorld.howdy //p /body /lift:surround /html Yes we have more boilerplate code but with that way it would be much more easier the edditing of the page. Yoryos --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] date management
As I proceed to enhance the ToDo example, I have added a new field to the ToDo.scala model: object dueOn extends MappedDateTime(this) { final val dateFormat = DateFormat.getDateInstance (DateFormat.SHORT) override def asHtml = Text(dateFormat.format(is))} Next, I added a binding in the TD.scala snippet within the add method of the TD class: def doBind(form: NodeSeq) = { bind(todo, form, desc - todo.desc.toForm, priority - todo.priority.toForm, dueOn - todo.dueOn.toForm, submit - submit(create new Task, checkAndSave)} Then, the todo.html template gets a bind point: lift:TD.add form=post ... todo:dueOn/ todo:submitbutton//todo:submit /lift:TD.add When I check the database, the record does save, and all the other fields are OK, but the date itself is null. Somehow, it seems the text of the input field is not getting changed into a Date object for the database to handle, right? When I look at the PocketChange app from the book, everything is done completely differently from the ToDo example (no use of _toForm, for instance). I know dates and times are convoluted in Java, so what am I missing? Thanks! --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: lift views
Folks, There's nothing that Lift does magically with lift:surround/ or lift:embed/ They just replace XML nodes. If you want to structure your apps to not have surround or embed, that's fine. If you want to surround or embed at different points in your files, totally cool. Do it however you want. It makes no difference to Lift. Lift's templating is just an XML substitution system. Substitute or don't at your pleasure. Do what works best for you. It makes no difference to Lift. Thanks, David On Sun, May 31, 2009 at 11:31 AM, Yoryos valo...@gmail.com wrote: No! I didn't missed that part. Like Xavi said the benefit is a valid html page. It would be much more intresting having something like html xmlns=http://www.w3.org/1999/xhtml; xmlns:lift=http:// liftweb.net/ head!-- I don't not if it's valid to just not even have a head tag when we don't want to --/head body lift:layout=default lift:name=content h2Welcome to your project!/h2 plift:helloWorld.howdy //p /body /html witch has less boilerplate (than my first example) and is very easy IMHO to understand and read. I'm very new to lift and I just think that telling something that would look easier to me, would also look easier to any newby. At the other hand, being newby also means that I don't have a good overview of the framework and it's design. It is better thought to say something event if it is wrong before you get used to it, because then you'll just get used to it!! Yoryos On May 31, 1:53 am, Charles F. Munat c...@munat.com wrote: Yoryos, You probably missed the part where you can add a head element inside the surround tags and it will replace the default element: lift:surround with=default2 at=content head titleA better title than the one in default.html/title /head h2Welcome to your project!/h2 plift:helloWorld.howdy //p /lift:surround I don't see that duplicating the html and body tags unnecessarily makes it any better. Just adds clutter, IMO. The fewer tags I have to deal with, the easier it is to read. Chas. valotas wrote: Hi all! Just a proposal: wouldn't be better to have the views look like more an html page. I mean for the basic project created, instead of having an index.html look like lift:surround with=default2 at=content h2Welcome to your project!/h2 plift:helloWorld.howdy //p /lift:surround have something like: html lift:surround with=default2 at=content head titleA better title than the one in default.html/title /head body h2Welcome to your project!/h2 plift:helloWorld.howdy //p /body /lift:surround /html Yes we have more boilerplate code but with that way it would be much more easier the edditing of the page. Yoryos -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---
[Lift] Re: Showing a Box or Redirecting?
class SomeSnippet { implicit def boxOpener(in: Box[NodeSeq]): NodeSeq = in openOr {S.error(Inactive); S.redirectTo(S.referer openOr /)} def showA(xhtml: NodeSeq): NodeSeq = for { id - S.param(id) info - session1.get(id) } yield bind(foo, xhtml, thing - info.x) } The implicit makes the Box[NodeSeq] turn into a NodeSeq or redirects the user. Thanks, David On Sat, May 30, 2009 at 6:12 PM, Bryan germ...@gmail.com wrote: If Foo has 5 methods that I need to show in a Snippet (scattered throughout the template), what's a good way to S.error(inactive); S.redirectTo(/) whenever Box[Foo] cannot be opened because it is not Full, without having to write a bunch of boiler plate code for each of the show methods I have defined below. class SomeSnippet { val foo: Box[Foo] = tryo(session1.get(S.param(id).getOrElse())) def showA(xhtml: NodeSeq): NodeSeq = ... def showB(xhtml: NodeSeq): NodeSeq = ... def showC(xhtml: NodeSeq): NodeSeq = ... def showD(xhtml: NodeSeq): NodeSeq = ... def showE(xhtml: NodeSeq): NodeSeq = ... } Thanks, Bryan -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~-~--~~~---~--~~ 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 email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~--~~~~--~~--~--~---