[Lift] Re: Forms validation formatter

2009-04-04 Thread marius d.



On Apr 2, 6:57 pm, Clemens Oertel clemens.oer...@gmail.com wrote:
 One follow up question, relating to the contexts I mentioned earlier:  
 Following my approach mentioned below, let's assume I have a template  
 for embedding. This template contains  the HTML code for a tabular  
 list of data entities. Depending on where the template is embedded,  
 some of the entities' fields should appear as links: There are 2  
 linkable reference fields A and B, and depending on the context,  
 either A, B, or A and B should be rendered as links to the referenced  
 entity.

 This logic obviously can't go into the template. Also, the model's  
 toForm method is unsuitable (having the model referring to a  
 RequestVar seems evil to me). No no, this should go into the snippet,  
 where such logic belongs. But this would mean having to go through the  
 templates XML tree before calling Site.toForm(site, form), enclosing  
 all affected liftf:field elements with the respective links. This  
 sounds very, very wrong.

 Thus, from my current understanding, this context-sensitive rendering  
 of fields is best done using the explicit lift-tag/bind approach. So  
 I'll probably have to have explicit bind calls anyways, and won't be  
 able to use my initial approach of having the mapper class (or it's  
 companion object) fill out the forms itself.

 I'd be happy if someone could prove me wrong ...

I don't necessarily see this in terms of right and wrong. Well your
embeddable template could use a snippet and you can potentially use
chooseTemplate to kind of shape the form template ... then you can
call toForm in this snippet hence passing only the appropriate form
template and not a huge template containing things that do not relate
with your form per se.


 Best,
 Clemens

 PS: Exercise for the reader: Instead of selective linking, have only  
 either A or B be displayed, depending on the embedding context.

 On 31-Mar-09, at 3:59 PM, marius d. wrote:





   Outer Template 
  lift:surround with=default at=content
     h2Create a New Site/h2

     lift:snippet type=SiteOps.add form=post eager_eval=true
       table
         tfoot
           tr
             td colspan=3site:submitSubmit/site:submit/td
           /tr
         /tfoot
         lift:embed what=/sites/_site /
       /table
     /lift:snippet
  /lift:surround
   End Outer Template 

   Embedded Template 
  tbody
  tr
       tdliftf:field_label name=nameName/liftf:field_label:/
  td
       tdliftf:field name=nameA Hospital Site/liftf:field/td
       tdliftf:field_msg name=name //td
  /tr
  /tbody
   End Embedded Template 

   SiteOps 
     def add(form: NodeSeq): NodeSeq = {
       val invokedAs = S.invokedAs
       val site = Site.create

       def newSite(form: NodeSeq): NodeSeq = {
         def saveMe(): Unit = {
           site.validate match {
             case Nil = site.save ; S.notice(Added  + site.name);
  S.redirectTo(/sites/)
             case xs = S.error(xs) ; S.mapSnippet(invokedAs, newSite)
           }
         }

         bind(site, Site.toForm(site, form), submit -
  submit(Save, saveMe))
       }

       newSite(form)
     }
   End SiteOps 

  The Site.toForm function is pretty much the same as found in
  MetaRecord. It will eventually call each fields' toForm function
  (which are the original Lift 1.0 mapper versions, no changes there).

  Am I really doing things outside the rendering pipeline (this is  
  not a
  rhetorical question)?

  Nope sorry ... I misunderstood your case. By bad entirely.

  It all seems to work, incl. validation.
  Also, the eagerly evaluated template, which will be passed to toForm,
  contains only field tags, no other lift tags.

  Again, imagine a few dozen different entities, each with a ton of
  fields. I'm sure you'll understand that I'm hesitant to bind each
  field manually (once for the list page, once for the display page,
  once for the add page, and again once for the edit page, even though
  the last 2 can surely be combined into one bind call in the code).
  I obviously have to declare each field in the model, and refer to it
  in the view. I really wouldn't mind not having to mention it anywhere
  inbetween.

  This is actually a nice thing to do. Sorry that I misunderstood your
  intentions :)

  Thank you for all your help,
  Clemens

  Clemens Oertel
  clem...@oertel.ca

 Clemens Oertel
 clem...@oertel.ca

 Clemens Oertel
 clem...@oertel.ca
--~--~-~--~~~---~--~~
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] PhET Website

2009-04-04 Thread samreid

Lift community,

My name is Sam Reid, I'm a Java + Scala developer for PhET Interactive
Simulations at http://phet.colorado.edu/.  We produce free, open
source educational science simulations for college and high school-
level students.  We are considering porting our website to Lift and
adding some functionality such as internationalization.  I was
wondering if there are any Lift developers who would be interested in
this work.  If you're interested, please look through our existing
website at http://phet.colorado.edu/ and provide a time/price estimate
to me at reids at colorado dot edu.  We have some existing databases
that would need to be supported, and the existing code is PHP+HTML
+JavaScript.  We currently average about 200,000 pageviews/day, and
we'll need to make sure that Lift is capable of this and more.  Please
let me know if you have questions or comments.

Thanks,
Sam Reid

--~--~-~--~~~---~--~~
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] Who did the hungarian translation?

2009-04-04 Thread Tim Perrett

Hey guys,

Who did the hungarian translations of lift core? I want to make an
addition that needs adding to lift core properties files but I don't
speak hungarian!

Cheers, Tim
--~--~-~--~~~---~--~~
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] newbie question: using ajaxText() to get integer from form

2009-04-04 Thread Tobias Daub

Hi There,

 From the ToDo tutorial I got this code:

private def desc(td: ToDo, reDraw: () = JsCmd) =
 swappable(span{td.desc}/span,
 span{ajaxText(td.desc,
 v = {td.desc(v).save; reDraw()})}
 /span)


What if I've a numeric field, e.g. td.num and I want to view/edit it?

I got to the point that I modified the code to look like this:

span{ajaxText(td.num.toString,
 v = {td.desc(v).save; reDraw()})}
 /span)


But I still get another compile error, that tells me, that it awaits 
String instead of Int.

What do I've to change here? I tried some things with toString() too, 
but all didn't worked.

v = {td.num(v).save; reDraw()})}


thanks
Tobias

--~--~-~--~~~---~--~~
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 using JQuery and JCarousel

2009-04-04 Thread wapgui

The problem is how the carousel looks like. It shows all the picture
one below the other. I know this effect, then normaly JQuery is
missing. But I can try it as snippet or lift:embed.

Cheers
Torsten

On Apr 3, 10:03 pm, marius d. marius.dan...@gmail.com wrote:
 Hmm ... I'd be very surprised if the the presence of the multiple
 ready function calls would cause this. Virtually you can have as many
 as you want. But what is the exact problem ?

 I could probably take a look tomorrow and maybe make a lift widget
 out of it.

 Br's,
 Marius

 P.S.
 You can render stuff in any place you want using various ways. For
 instance:

 1. Use a snippet
 2. Use lift:embed
 3.You can post process resulting xml before it is sent to client (a
 pretty uncommon need)

 I I'd really doubt that this would represent the solution.

 On Apr 3, 11:32 am, wapgui torsten.schm...@wapgui.com wrote:
  Hi,

  had anybody success including the JCarousel plugin into Lift.
  Here is my default.html

   html xml:lang=en-us xmlns=http://www.w3.org/1999/xhtml;
  xmlns:lif=http://liftweb.net/;
          head
                  meta http-equiv=content-type content=text/html;
  charset=ISO-8859-1/
                  titlejCarousel Examples/title
                  lift:CSS.blueprint/
                  lift:CSS.fancyType/
                  link href=css/style.css rel=stylesheet 
  type=text/css/
                  script id=jquery type=text/javascript src=classpath/
  jquery.js/script
                  script id=json type=text/javascript 
  src=classpath/json.js/
  script
                  script type=text/javascript 
  src=js/jquery.jcarousel.pack.js/
  script
                  link rel=stylesheet type=text/css href=css/
  jquery.jcarousel.css/
                  link rel=stylesheet type=text/css href=css/skin.css/
                  script type=text/javascript
                          jQuery(document).ready(function() {
                              jQuery('#mycarousel').jcarousel();
                          });
                  /script
                  script type='text/javascript' 
  src='http://getfirebug.com/releases/
  lite/1.2/firebug-lite-compressed.js'/script
          /head
          body
                  div id=wrap
                          h1jCarousel/h1
                          h2Riding carousels with jQuery/h2
                          h3Simple carousel/h3
                          pThis is the most simple usage of the carousel 
  with no
  configuration options./p
                          ul id=mycarousel class=jcarousel-skin-tango
                                  liimg src=http://static.flickr.com/
  66/199481236_dc98b5abb3_s.jpg//li
                              liimg src=http://static.flickr.com/
  75/199481072_b4a0d09597_s.jpg//li
                              liimg src=http://static.flickr.com/
  57/199481087_33ae73a8de_s.jpg//li
                              liimg src=http://static.flickr.com/
  77/199481108_4359e6b971_s.jpg//li
                              liimg src=http://static.flickr.com/
  58/199481143_3c148d9dd3_s.jpg//li
                              liimg src=http://static.flickr.com/
  72/199481203_ad4cdcf109_s.jpg//li
                              liimg src=http://static.flickr.com/
  58/199481218_264ce20da0_s.jpg//li
                              liimg src=http://static.flickr.com/
  69/199481255_fdfe885f87_s.jpg//li
                              liimg src=http://static.flickr.com/
  60/199480111_87d4cb3e38_s.jpg//li
                              liimg src=http://static.flickr.com/
  70/229228324_08223b70fa_s.jpg//li
                          /ul
                  /div
                  lift:bind name=content/
          /body
  /html

  and this is my index.html

  lift:surround with=default at=content

  /lift:surround

  The generated page is

  ?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 xml:lang=en-us xmlns:lif=http://liftweb.net/; 
  xmlns=http://www.w3.org/1999/xhtml;head
                  meta content=text/html; charset=ISO-8859-1 
  http-equiv=content-
  type /
                  titlejCarousel Examples/title

      link href=/classpath/blueprint/screen.css type=text/css
  rel=stylesheet media=screen, projection /
      link href=/classpath/blueprint/print.css type=text/css
  rel=stylesheet media=print /

    !--[if IE]link rel=stylesheet href=/classpath/blueprint/
  ie.css type=text/css media=screen, projection![endif]--

                  link 
  href=/classpath/blueprint/plugins/fancy-type/screen.css
  type=text/css rel=stylesheet media=screen, projection /
                  link type=text/css rel=stylesheet href=css/style.css 
  /

                  script src=classpath/jquery.js type=text/javascript
  id=jquery/script
                  script src=classpath/json.js type=text/javascript 
  id=json/
  script
                  script src=js/jquery.jcarousel.pack.js 
  

[Lift] Re: Need for lightweight JPA archetype

2009-04-04 Thread bradford

Hi,

I think I would like to use JPA for my project.  This archetype would
be nice.  Just a second ago I ran mvn archtype:generate on lift-
archetype-jpa-basic.  NetBeans is complaining on 'import
javax.persistence._' not being found in jpatest-spa's Author.scala.
It also complains on 'import org.scala_libs.jpa._' in jpatest-web's
Model.scala.

Thanks,
Bradford

On Apr 3, 4:45 am, Charles F. Munat c...@munat.com wrote:
 No, I meant there were a few candidates for a first commit, not that
 someone else should do it. I have my fingers in a bunch of things at the
 moment...

 At the moment, however, I have to pay the bills. But I'll keep tinkering.

 Chas.

 Timothy Perrett wrote:
  Probally between yourself and Derek in all honesty - I simply dont
  have the time right now and my lift time and what I do with it has
  other investments right now...

  Derek might well be swamped with the book at the moment... so perhaps
  there are not so many candidates as you think :-)

  Crack on is what I say - make a branch, knock yourself out and then
  post to the list before merging to master

  Cheers, Tim

  On Apr 2, 7:17 pm, Charles F. Munat c...@munat.com wrote:
  Yup. But there seem to be a few candidates...

  Timothy Perrett wrote:
  Are you eyeing up for your first commit Chas? ;-)
  The src of the JPA archetype is here:
 http://github.com/dpp/liftweb/tree/4a5d4530b407782a2f0e0e99b277432dbb...
  Cheers, Tim
  On Apr 2, 6:02 pm, Charles F. Munat c...@munat.com wrote:
  Where is the code for these archetypes and how tricky is it to create 
  them?
  Chas.

--~--~-~--~~~---~--~~
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] Updates to the book and JPA demo site

2009-04-04 Thread Derek Chen-Becker
I've updated the JPA chapter of the book with brief coverage of the
Hibernate Validator framework for entity validation. A new PDF is up on the
group site. Also, as part of testing the new section, I added hibernate
validator functionality to the current JPA demo site on my own branch. Does
anyone think it would be useful to commit the branch to master so that it's
part of the demo site, or would it be better to push it as a separate
branch?

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: Who did the hungarian translation?

2009-04-04 Thread Timothy Perrett


Hey Marius 

Sounds good. I just want to add an Undefined item to the Genders object in
Mapper, however it needs updating in our core locale strings so just need a
HU translation for Undefined

Cheers, Tim

On 04/04/2009 15:16, marius d. marius.dan...@gmail.com wrote:

 
 A co-worker of mine. I could have him do the translation on Monday ...
 just send the English text.
 
 Br's,
 Marius
 
 On Apr 4, 3:23 pm, Tim Perrett timo...@getintheloop.eu wrote:
 Hey guys,
 
 Who did the hungarian translations of lift core? I want to make an
 addition that needs adding to lift core properties files but I don't
 speak hungarian!
 
 Cheers, Tim
  
 



--~--~-~--~~~---~--~~
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 using JQuery and JCarousel

2009-04-04 Thread marius d.

might be that blueprint's css ul/li styles are conflicting with list
styles that JCarousel is using? Try to not use:

lift:CSS.blueprint/
lift:CSS.fancyType/

... and see if things get improved.

Br's,
Marius

On Apr 4, 6:18 pm, wapgui torsten.schm...@wapgui.com wrote:
 The problem is how the carousel looks like. It shows all the picture
 one below the other. I know this effect, then normaly JQuery is
 missing. But I can try it as snippet or lift:embed.

 Cheers
 Torsten

 On Apr 3, 10:03 pm, marius d. marius.dan...@gmail.com wrote:

  Hmm ... I'd be very surprised if the the presence of the multiple
  ready function calls would cause this. Virtually you can have as many
  as you want. But what is the exact problem ?

  I could probably take a look tomorrow and maybe make a lift widget
  out of it.

  Br's,
  Marius

  P.S.
  You can render stuff in any place you want using various ways. For
  instance:

  1. Use a snippet
  2. Use lift:embed
  3.You can post process resulting xml before it is sent to client (a
  pretty uncommon need)

  I I'd really doubt that this would represent the solution.

  On Apr 3, 11:32 am, wapgui torsten.schm...@wapgui.com wrote:
   Hi,

   had anybody success including the JCarousel plugin into Lift.
   Here is my default.html

    html xml:lang=en-us xmlns=http://www.w3.org/1999/xhtml;
   xmlns:lif=http://liftweb.net/;
           head
                   meta http-equiv=content-type content=text/html;
   charset=ISO-8859-1/
                   titlejCarousel Examples/title
                   lift:CSS.blueprint/
                   lift:CSS.fancyType/
                   link href=css/style.css rel=stylesheet 
   type=text/css/
                   script id=jquery type=text/javascript src=classpath/
   jquery.js/script
                   script id=json type=text/javascript 
   src=classpath/json.js/
   script
                   script type=text/javascript 
   src=js/jquery.jcarousel.pack.js/
   script
                   link rel=stylesheet type=text/css href=css/
   jquery.jcarousel.css/
                   link rel=stylesheet type=text/css 
   href=css/skin.css/
                   script type=text/javascript
                           jQuery(document).ready(function() {
                               jQuery('#mycarousel').jcarousel();
                           });
                   /script
                   script type='text/javascript' 
   src='http://getfirebug.com/releases/
   lite/1.2/firebug-lite-compressed.js'/script
           /head
           body
                   div id=wrap
                           h1jCarousel/h1
                           h2Riding carousels with jQuery/h2
                           h3Simple carousel/h3
                           pThis is the most simple usage of the carousel 
   with no
   configuration options./p
                           ul id=mycarousel class=jcarousel-skin-tango
                                   liimg src=http://static.flickr.com/
   66/199481236_dc98b5abb3_s.jpg//li
                               liimg src=http://static.flickr.com/
   75/199481072_b4a0d09597_s.jpg//li
                               liimg src=http://static.flickr.com/
   57/199481087_33ae73a8de_s.jpg//li
                               liimg src=http://static.flickr.com/
   77/199481108_4359e6b971_s.jpg//li
                               liimg src=http://static.flickr.com/
   58/199481143_3c148d9dd3_s.jpg//li
                               liimg src=http://static.flickr.com/
   72/199481203_ad4cdcf109_s.jpg//li
                               liimg src=http://static.flickr.com/
   58/199481218_264ce20da0_s.jpg//li
                               liimg src=http://static.flickr.com/
   69/199481255_fdfe885f87_s.jpg//li
                               liimg src=http://static.flickr.com/
   60/199480111_87d4cb3e38_s.jpg//li
                               liimg src=http://static.flickr.com/
   70/229228324_08223b70fa_s.jpg//li
                           /ul
                   /div
                   lift:bind name=content/
           /body
   /html

   and this is my index.html

   lift:surround with=default at=content

   /lift:surround

   The generated page is

   ?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 xml:lang=en-us xmlns:lif=http://liftweb.net/; 
   xmlns=http://www.w3.org/1999/xhtml;head
                   meta content=text/html; charset=ISO-8859-1 
   http-equiv=content-
   type /
                   titlejCarousel Examples/title

       link href=/classpath/blueprint/screen.css type=text/css
   rel=stylesheet media=screen, projection /
       link href=/classpath/blueprint/print.css type=text/css
   rel=stylesheet media=print /

     !--[if IE]link rel=stylesheet href=/classpath/blueprint/
   ie.css type=text/css media=screen, projection![endif]--

                   link 
   

[Lift] Re: Advice on Ramping Up

2009-04-04 Thread Charles F. Munat

Thus suggesting our motto:

Scala/Lift: Our heads are in the stars, but our feet are firmly planted 
in the, er, soil.

Chas.

David Pollak wrote:
 And of course Beginning Scala is BS :-)
 
 On Fri, Apr 3, 2009 at 8:29 PM, Meredith Gregory 
 lgreg.mered...@gmail.com mailto:lgreg.mered...@gmail.com wrote:
 
 Jorge,
 
 i was going to express a similar sentiment. There are lots of
 available options.
 
 * PinS
 * PrinS
 * PrinSc
 
 Best wishes,
 
 --greg
 
 
 On Fri, Apr 3, 2009 at 5:51 PM, Jorge Ortiz jorge.or...@gmail.com
 mailto:jorge.or...@gmail.com wrote:
 
 Aside: I think the preferred abbreviation for Programming in
 Scala is PinS, not PiS.
 
 Just fyi,
 
 --j
 
 
 On Fri, Apr 3, 2009 at 4:15 PM, Timothy Perrett
 timo...@getintheloop.eu wrote:
 
 
 
 My advice, if your generally / vaugly familiar with Scala
 from reading PiS
 (that truly is a very unfortunate acronym!) just dive into
 making a lift
 app, then go from there.
 
 One of the best things about Lift is the community - if you
 have questions,
 chances are its either already in the group archive from one
 of our many
 debates, or in the lift book, or if not, just ask on the
 mailing list and
 someone will no doubt help you right quick!
 
 Good luck!
 
 Tim
 
 
 On 03/04/2009 23:01, Charles F. Munat c...@munat.com
 mailto:c...@munat.com wrote:
 
  
   I'd suggest that you start working in Lift, then when you
 encounter
   something that doesn't make sense to you, refer to the
 PiS book
   (unfortunate acronym). It helps if you have the PDF
 version because you
   can search. The index is OK, but often insufficient.
  
   This is the approach I used to get started, though
 eventually I went
   back and read most of the book sequentially (I still have
 a couple of
   chapters to go). Take a look also at DPP's book and the
 online Lift
   book, both easily searchable.
  
   If you want to jump ahead in the book, I'd recommend the
 following:
  
   15: Case Classes and Pattern Matching
   16: Working with Lists
   23: For Expressions Revisited
  
   Lists, for expressions, case classes, and pattern
 matching are used *all
   over the place* in Lift. You can't be too familiar with
 these.
  
   Then maybe:
  
   19: Type Parameterization
   21: Implicit Conversions and Parameters
  
   You don't need to understand those thoroughly, but having
 some
   familiarity with them will help with debugging and
 understanding what
   the heck is going on.
  
   If you have time, you could also read the following to
 fill in a few gaps:
  
   22: Implementing Lists
   26: Working with XML
  
   And if you're going to use Comet, you should probably read:
  
   30: Actors and Concurrency
  
   But again, you can dive in and then reference these
 chapters as necessary.
  
   Chas.
  
   lmorroni wrote:
   Hi,
   I am a Java programmer that is interested in learning
 Lift.  I have
   just finished the first six chapters of Programming in
 Scala.  I
   wonder what people's opinions are on how much of this
 book I need to
   read before diving into Lift.  I attempted to dive into
 Lift without
   reading anything on Scala and that worked great until I
 wanted to
   start reviewing the Lift libraries :)
   Maybe there are some chapters in this book that I can
 skip?  I think
   the book is really well written and I have followed
 everything so
   far.  I just would rather get rolling on Lift sooner
 rather than
   later.
   Larry
  
  
  
   
  
 
 
 
 
 
 
 
 
 
 
 -- 
 L.G. Meredith
 Managing Partner
 Biosimilarity LLC
 1219 83rd St NW
 Seattle, WA 98117
 
 +1 206.650.3740
 
 http://biosimilarity.blogspot.com
 
 
 
 
 
 
 -- 
 Lift, the simply functional web framework http://liftweb.net
 

[Lift] Re: Compile error in TD.scala whith example in Starting with Lift HTML guide

2009-04-04 Thread Derek Chen-Becker
This is something I'm aware of and working on, but feel free to report a bug
here:

http://liftweb.lighthouseapp.com/projects/26102-lift/tickets

Derek

On Fri, Apr 3, 2009 at 5:50 PM, Dano! daniel.mcka...@gmail.com wrote:



 I thought I replied to this, apologies if it comes up twice.

 I found the problem, the HTML shows tildes (~) rather than quotes
 ().  The PDF is fine (though copy and paste doesn't work as well).  I
 assumed it was a Lift or Scala weirdness.

 Next question, where to file a bug about this?

 Dano!



 On Apr 3, 3:19 pm, Dano! daniel.mcka...@gmail.com wrote:
  Good morning,
 
  Scala has been getting some interest in the project I work with, and
  I've been asked to investigate the Lift framework as a possibility to
  migrate our custom coded website to it.  I'm a Scala newbie, so I'm
  working on absorbing a lot in a short period of time.
 
  I'm having problems with the Stating with Lift found at:
 http://liftweb.net/docs/getting_started/mod_master.html
 
  I was able to get everything working up through section 2.8.  I'm
  getting stuck in Section 2.12 where it suggests starting the server
  and trying the changes from Section 2.9.
 
  Specifically I'm getting hung up with a compile time error with
  TD.scala.  First I get these two errors:
 
  $ mvn jetty:run
  ...
  [INFO] Checking for multiple versions of scala
  [INFO] Compiling 3 source files to /Users/danielmckagan/Workspaces/
  lift-test/todo/target/classes
  [WARNING] /Users/danielmckagan/Workspaces/lift-test/todo/src/main/
  scala/com/liftworkshop/model/ToDo.scala:29: error: ')' expected but
  integer literal found.
  [WARNING] valMinLen(3, ~Description must be 3 characters~) _ ::
  [WARNING]   ^
  [WARNING] /Users/danielmckagan/Workspaces/lift-test/todo/src/main/
  scala/com/liftworkshop/snippet/TD.scala:33: error: ')' expected but
  '.' found.
  [WARNING]   ~priority~ - todo.priority.toForm,
  [WARNING] ^
  [WARNING] two errors found
  ...
 
  If I change the '3' to 'three' in the first example, that error falls
  away and the second one remains:
 
  ...
  [INFO] Checking for multiple versions of scala
  [INFO] Compiling 3 source files to /Users/danielmckagan/Workspaces/
  lift-test/todo/target/classes
  [WARNING] /Users/danielmckagan/Workspaces/lift-test/todo/src/main/
  scala/com/liftworkshop/snippet/TD.scala:33: error: ')' expected but
  '.' found.
  [WARNING]   ~priority~ - todo.priority.toForm,
  [WARNING] ^
  [WARNING] one error found
  ...
 
  And I can't figure out how to get over it.  I deleted the entire todo
  project and started from the beginning, cutting and pasting the
  examples, and have gotten the same behavior both times.
 
  This may help...
 
  $ mvn --version
  Apache Maven 2.1.0 (r755702; 2009-03-18 12:10:27-0700)
  Java version: 1.5.0_16
  Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/
  Home
  Default locale: en_US, platform encoding: MacRoman
  OS name: mac os x version: 10.5.6 arch: i386 Family: unix
 
  Any help would be appreciated,
  Dano!

 


--~--~-~--~~~---~--~~
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: Menu widget

2009-04-04 Thread Derek Chen-Becker
That's probably it. Please let us know if adding the snapshots repo doesn't
fix it.

Derek

On Fri, Apr 3, 2009 at 10:05 PM, Josh Suereth joshua.suer...@gmail.comwrote:


 Don't know if anyone responded, but you may need to add the maven
 snapshot repository to your pom as well.

 Sent from my iPhone

 On Apr 3, 2009, at 2:36 PM, DavidV david.v.villa...@gmail.com wrote:

 
  I added the dependency to my pom.xml exactly as you suggested and I'm
  getting this error:
 
  Downloading:
 http://scala-tools.org/repo-releases/net/liftweb/lift-widgets/1.1-S
  NAPSHOT/lift-widgets-1.1-SNAPSHOT.jar
  [INFO]
  ---
  -
  [ERROR] BUILD ERROR
  [INFO]
  ---
  -
  [INFO] Failed to resolve artifact.
 
  Missing:
  --
  1) net.liftweb:lift-widgets:jar:1.1-SNAPSHOT
 
   Try downloading the file manually from the project website.
 
   Then, install it using the command:
   mvn install:install-file -DgroupId=net.liftweb -DartifactId=lift-
  widgets -
  Dversion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
 
   Alternatively, if you host your own repository you can deploy the
  file there:
 
   mvn deploy:deploy-file -DgroupId=net.liftweb -DartifactId=lift-
  widgets -Dv
  ersion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -
  Drepositor
  yId=[id]
 
   Path to dependency:
 1) testLift:testLift:war:1.0
 2) net.liftweb:lift-widgets:jar:1.1-SNAPSHOT
 
  --
  1 required artifact is missing.
 
  for artifact:
   testLift:testLift:war:1.0
 
  from the specified remote repositories:
   scala-tools.org (http://scala-tools.org/repo-releases),
   central (http://repo1.maven.org/maven2)
 
 
  I changed the dependency version to 1.0 because I followed the scala-
  tools.org link (http://scala-tools.org/repo-releases) and noticed that
  there wasn't a 1.1-SNAPSHOT version in net\liftweb\lift-widgets.
  Maven then compiled the project, but my menu still isn't showing up as
  I would like it to.  I haven't changed my template.
 
  On Apr 2, 11:07 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
  Do you have lift-widgets module as a dependency in your pom.xml?
 
  dependency
groupIdnet.liftweb/groupId
artifactIdlift-widgets/artifactId
version1.1-SNAPSHOT/version
  /dependency
 
  That's needed to get the dropdown widget code.
 
  Derek
 
  On Thu, Apr 2, 2009 at 3:13 PM, DavidV david.v.villa...@gmail.com
  wrote:
 
  I posted this yesterday but I haven't seen it appear yet...sorry
  if it
  is here twice.
 
  I downloaded the scripts separately because I didn't know how to
  update my repository/library to include the MenuWidget class and the
  appropriate .js and .css files.  I tried running mvn install on my
  webapp, but it didn't download those new files.
  I fixed the problem with my .css file so it compiles now, however
  I'm
  still not getting the nice stylish superfish navbar.  Instead, I'm
  getting a vertical bulleted list of links to my different pages.  I
  think it's a problem with my template.  Here are the relevant
  sections:
 
  html xmlns=http://www.w3.org/1999/xhtml; xmlns:lift=http://
  liftweb.net/
   head
 meta http-equiv=content-type content=text/html;
  charset=UTF-8 /
 meta name=description content= /
 meta name=keywords content= /
 
 titleMy WebApp lift:Menu.title / /title
 lift:StyleSheet.entryForm /
 lift:StyleSheet.fancyType /
 script id=jquery src=/classpath/jquery.js type=text/
  javascript/
 script id=json src=/classpath/json.js type=text/
  javascript/
 
 /head
 body
 
 div class=container
   div style=text-align: center
   br/
 h1 class=alt
   Welcome to My WebApp /h1
  /div
   hr/
 
  div
 lift:MyMenu.render /
div
lift:Msgs/
hr class=space /
   /div
   /div
 
  MyMenu is the snippet that contains the render method, which looks
  like this:
 
   def render(xhtml: NodeSeq): NodeSeq = {
 MenuWidget(MenuStyle.NAVBAR)
   }
 
  Does anyone see what might be wrong here?
 
  Thanks,
  David
 
  On Apr 1, 11:04 am, marius d. marius.dan...@gmail.com wrote:
  Is there a reason why you downloaded he scripts separately? ... the
  superfish dependencies are offered by the widget. Please see the
  lift-
  widgets project and the test applicaiton from there.
 
  Br's,
  Marius
 
  On Mar 31, 11:48 pm, DavidV david.v.villa...@gmail.com wrote:
 
  I would like to use this newMenuWidget, so I got the source code
  from
  GitHub and put it into my application as a snippet.  I also
  downloaded
  all of the necessary superfish .css and .js files from the
  superfish
  website and put those in local sub-directories of the src/main/
  webapp folder.  When I try to compile the code in maven,
  however, I
  get the following error.
 
  

[Lift] Re: Need for lightweight JPA archetype

2009-04-04 Thread Derek Chen-Becker
Hmmm. Does maven complain if you try to compile, or is it just NetBeans?

Derek

On Sat, Apr 4, 2009 at 9:31 AM, bradford fingerm...@gmail.com wrote:


 Hi,

 I think I would like to use JPA for my project.  This archetype would
 be nice.  Just a second ago I ran mvn archtype:generate on lift-
 archetype-jpa-basic.  NetBeans is complaining on 'import
 javax.persistence._' not being found in jpatest-spa's Author.scala.
 It also complains on 'import org.scala_libs.jpa._' in jpatest-web's
 Model.scala.

 Thanks,
 Bradford

 On Apr 3, 4:45 am, Charles F. Munat c...@munat.com wrote:
  No, I meant there were a few candidates for a first commit, not that
  someone else should do it. I have my fingers in a bunch of things at the
  moment...
 
  At the moment, however, I have to pay the bills. But I'll keep tinkering.
 
  Chas.
 
  Timothy Perrett wrote:
   Probally between yourself and Derek in all honesty - I simply dont
   have the time right now and my lift time and what I do with it has
   other investments right now...
 
   Derek might well be swamped with the book at the moment... so perhaps
   there are not so many candidates as you think :-)
 
   Crack on is what I say - make a branch, knock yourself out and then
   post to the list before merging to master
 
   Cheers, Tim
 
   On Apr 2, 7:17 pm, Charles F. Munat c...@munat.com wrote:
   Yup. But there seem to be a few candidates...
 
   Timothy Perrett wrote:
   Are you eyeing up for your first commit Chas? ;-)
   The src of the JPA archetype is here:
  
 http://github.com/dpp/liftweb/tree/4a5d4530b407782a2f0e0e99b277432dbb...
   Cheers, Tim
   On Apr 2, 6:02 pm, Charles F. Munat c...@munat.com wrote:
   Where is the code for these archetypes and how tricky is it to
 create them?
   Chas.

 


--~--~-~--~~~---~--~~
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: newbie question: using ajaxText() to get integer from form

2009-04-04 Thread David Pollak
On Sat, Apr 4, 2009 at 6:02 AM, Tobias Daub hannes.flo...@gmx.li wrote:


 Hi There,

  From the ToDo tutorial I got this code:

 private def desc(td: ToDo, reDraw: () = JsCmd) =
  swappable(span{td.desc}/span,
 span{ajaxText(td.desc,
 v = {td.desc(v).save; reDraw()})}
 /span)


 What if I've a numeric field, e.g. td.num and I want to view/edit it?

 I got to the point that I modified the code to look like this:

 span{ajaxText(td.num.toString,
 v = {td.desc(v).save; reDraw()})}
 /span)


 But I still get another compile error, that tells me, that it awaits
 String instead of Int.

 What do I've to change here? I tried some things with toString() too,
 but all didn't worked.

 v = {td.num(v).save; reDraw()})}



td.num is looking for an Int.  v is a String.

Try:
v = {td.num(v.toInt).save; reDraw()}





 thanks
 Tobias

 



-- 
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] Newbie problem

2009-04-04 Thread mgm

What's wrong with this?

 AP.scala (extract)
  def list(xhtml: NodeSeq) = {
System.err.println(*** list:  + xhtml)
Airport.findAll.flatMap(ap = bind(ap, xhtml,
  code - ap.code, lat - ap.lattitude, lon -
ap.longitude))
  }
 airports.html ===
lift:surround with=default at=content
table
  lift:AP.list
tr
  tdap:codeXYZ/ap:code/td
  tdap:lat0/ap:lat/td
  tdap:lonTo Do/ap:lon/td
/tr
  /lift:AP.list
/table
/lift:surround

 http://localhost:8080/airports ===
XML Parsing Error: prefix not bound to a namespace
Location: http://localhost:8080/airports
Line Number 79, Column 15:  tdap:codeXYZ/ap:code/td
--^

 console log ===
*** list:
tr
  tdap:codeXYZ/ap:code/td
  tdap:lat0/ap:lat/td
  tdap:lonTo Do/ap:lon/td
/tr

WARN - Snippet Failure: SnippetFailure(/airports - ParsePath(List
(airports),,true,false),Full(AP.list),Method Not Found)

--~--~-~--~~~---~--~~
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 using JQuery and JCarousel

2009-04-04 Thread wapgui

Nope, there is no difference. Maybe I can find it out with the good
old try and error method.

On Apr 4, 8:30 pm, marius d. marius.dan...@gmail.com wrote:
 might be that blueprint's css ul/li styles are conflicting with list
 styles that JCarousel is using? Try to not use:

                 lift:CSS.blueprint/
                 lift:CSS.fancyType/

 ... and see if things get improved.

 Br's,
 Marius

 On Apr 4, 6:18 pm, wapgui torsten.schm...@wapgui.com wrote:

  The problem is how the carousel looks like. It shows all the picture
  one below the other. I know this effect, then normaly JQuery is
  missing. But I can try it as snippet or lift:embed.

  Cheers
  Torsten

  On Apr 3, 10:03 pm, marius d. marius.dan...@gmail.com wrote:

   Hmm ... I'd be very surprised if the the presence of the multiple
   ready function calls would cause this. Virtually you can have as many
   as you want. But what is the exact problem ?

   I could probably take a look tomorrow and maybe make a lift widget
   out of it.

   Br's,
   Marius

   P.S.
   You can render stuff in any place you want using various ways. For
   instance:

   1. Use a snippet
   2. Use lift:embed
   3.You can post process resulting xml before it is sent to client (a
   pretty uncommon need)

   I I'd really doubt that this would represent the solution.

   On Apr 3, 11:32 am, wapgui torsten.schm...@wapgui.com wrote:
Hi,

had anybody success including the JCarousel plugin into Lift.
Here is my default.html

 html xml:lang=en-us xmlns=http://www.w3.org/1999/xhtml;
xmlns:lif=http://liftweb.net/;
        head
                meta http-equiv=content-type content=text/html;
charset=ISO-8859-1/
                titlejCarousel Examples/title
                lift:CSS.blueprint/
                lift:CSS.fancyType/
                link href=css/style.css rel=stylesheet 
type=text/css/
                script id=jquery type=text/javascript 
src=classpath/
jquery.js/script
                script id=json type=text/javascript 
src=classpath/json.js/
script
                script type=text/javascript 
src=js/jquery.jcarousel.pack.js/
script
                link rel=stylesheet type=text/css href=css/
jquery.jcarousel.css/
                link rel=stylesheet type=text/css 
href=css/skin.css/
                script type=text/javascript
                        jQuery(document).ready(function() {
                            jQuery('#mycarousel').jcarousel();
                        });
                /script
                script type='text/javascript' 
src='http://getfirebug.com/releases/
lite/1.2/firebug-lite-compressed.js'/script
        /head
        body
                div id=wrap
                        h1jCarousel/h1
                        h2Riding carousels with jQuery/h2
                        h3Simple carousel/h3
                        pThis is the most simple usage of the 
carousel with no
configuration options./p
                        ul id=mycarousel 
class=jcarousel-skin-tango
                                liimg src=http://static.flickr.com/
66/199481236_dc98b5abb3_s.jpg//li
                            liimg src=http://static.flickr.com/
75/199481072_b4a0d09597_s.jpg//li
                            liimg src=http://static.flickr.com/
57/199481087_33ae73a8de_s.jpg//li
                            liimg src=http://static.flickr.com/
77/199481108_4359e6b971_s.jpg//li
                            liimg src=http://static.flickr.com/
58/199481143_3c148d9dd3_s.jpg//li
                            liimg src=http://static.flickr.com/
72/199481203_ad4cdcf109_s.jpg//li
                            liimg src=http://static.flickr.com/
58/199481218_264ce20da0_s.jpg//li
                            liimg src=http://static.flickr.com/
69/199481255_fdfe885f87_s.jpg//li
                            liimg src=http://static.flickr.com/
60/199480111_87d4cb3e38_s.jpg//li
                            liimg src=http://static.flickr.com/
70/229228324_08223b70fa_s.jpg//li
                        /ul
                /div
                lift:bind name=content/
        /body
/html

and this is my index.html

lift:surround with=default at=content

/lift:surround

The generated page is

?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 xml:lang=en-us xmlns:lif=http://liftweb.net/; 
xmlns=http://www.w3.org/1999/xhtml;head
                meta content=text/html; charset=ISO-8859-1 
http-equiv=content-
type /
                titlejCarousel Examples/title

    link href=/classpath/blueprint/screen.css type=text/css
rel=stylesheet media=screen, 

[Lift] Re: Need for lightweight JPA archetype

2009-04-04 Thread Derek Chen-Becker
If you have a second, could you send the stack trace for the NPE? That's
definitely not something that should be happening.

Derek

On Sat, Apr 4, 2009 at 2:34 PM, bradford fingerm...@gmail.com wrote:


 Yeah, just NetBeans.  It probably makes sense, but everything in
 NetBeans was fine after I did mvn compile; mvn install.  Running the
 app works too.  I did happen to get a NullPointerException when I
 would add a book with no author.  And then again when I would click on
 Book list.  Just an FYI.

 Thanks a lot for the demo and your help.

 Thanks,
 Bradford

 On Apr 4, 3:26 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
  Hmmm. Does maven complain if you try to compile, or is it just NetBeans?
 
  Derek
 
  On Sat, Apr 4, 2009 at 9:31 AM, bradford fingerm...@gmail.com wrote:
 
   Hi,
 
   I think I would like to use JPA for my project.  This archetype would
   be nice.  Just a second ago I ran mvn archtype:generate on lift-
   archetype-jpa-basic.  NetBeans is complaining on 'import
   javax.persistence._' not being found in jpatest-spa's Author.scala.
   It also complains on 'import org.scala_libs.jpa._' in jpatest-web's
   Model.scala.
 
   Thanks,
   Bradford
 
   On Apr 3, 4:45 am, Charles F. Munat c...@munat.com wrote:
No, I meant there were a few candidates for a first commit, not that
someone else should do it. I have my fingers in a bunch of things at
 the
moment...
 
At the moment, however, I have to pay the bills. But I'll keep
 tinkering.
 
Chas.
 
Timothy Perrett wrote:
 Probally between yourself and Derek in all honesty - I simply dont
 have the time right now and my lift time and what I do with it
 has
 other investments right now...
 
 Derek might well be swamped with the book at the moment... so
 perhaps
 there are not so many candidates as you think :-)
 
 Crack on is what I say - make a branch, knock yourself out and then
 post to the list before merging to master
 
 Cheers, Tim
 
 On Apr 2, 7:17 pm, Charles F. Munat c...@munat.com wrote:
 Yup. But there seem to be a few candidates...
 
 Timothy Perrett wrote:
 Are you eyeing up for your first commit Chas? ;-)
 The src of the JPA archetype is here:
 
  http://github.com/dpp/liftweb/tree/4a5d4530b407782a2f0e0e99b277432dbb.
 ..
 Cheers, Tim
 On Apr 2, 6:02 pm, Charles F. Munat c...@munat.com wrote:
 Where is the code for these archetypes and how tricky is it to
   create them?
 Chas.

 


--~--~-~--~~~---~--~~
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: Newbie problem

2009-04-04 Thread mgm

That did the trick!

I apologize for the hubris of a newbie, but I think this is a bug in
LiftWeb.

It was getting executed, but I guess with out the declaration, the
result was not getting implicitly converted from List[Node] to
NodeSeq.
The framework was finding  executing the method, but because the
returned value was not NodeSeq, it did not replace the HTML, I'm
guessing.

Lift should check  replace if the result any  Seq[Node], not just
NodeSeq.

Should I report this as a bug?


On Apr 4, 4:26 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 Change your list def to

 def list(xhtml : NodeSeq) : NodeSeq = { ...

 If you don't explicitly set the return type to NodeSeq, sometimes things
 don't get properly applied.

 Derek

 On Sat, Apr 4, 2009 at 2:55 PM, mgm mgm7...@gmail.com wrote:

  I added some more debug prints. The list method appears to be doing
  what I expected, though the empty list elements are odd.

   AP.scala (extract)
   def list(xhtml: NodeSeq) = {
     System.err.println(*** list:  + xhtml)
      val r = Airport.findAll.flatMap(ap = {
       System.err.println(ap= + ap)
        bind(ap, xhtml,
            code - ap.code, lat - ap.lattitude, lon -
  ap.longitude)
     })
      System.err.println(*** r= + r)
      r
   }

   console log ===
  *** list:
         tr
           tdap:codeXYZ/ap:code/td
           tdap:lat0/ap:lat/td
           tdap:lonTo Do/ap:lon/td
         /tr

  ap=com.flyspy.bf.model.Airport=
  {id=1,code=ORD,lattitude=50.0,longitude=-60.0}
  ap=com.flyspy.bf.model.Airport=
  {id=2,code=MSP,lattitude=40.0,longitude=-60.0}
  *** r=List(
         , tr
           tdORD/td
           td50.0/td
           td-60.0/td
         /tr,
       ,
         , tr
           tdMSP/td
           td40.0/td
           td-60.0/td
          /tr,
       )
  WARN - Snippet Failure: SnippetFailure(/airports - ParsePath(List
  (airports),,true,false),Full(AP.list),Method Not Found)

--~--~-~--~~~---~--~~
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] Unit tests for views snippets

2009-04-04 Thread erik.karls...@iki.fi

Hi,

First thanks for the great framework. It has been long time when I had
this fun with web programming :)

I have a pretty newbie question about unit testing. Do anybody know
good examples about how to write properly unit tests for views and
snippets?  I have written some tests with Specs for those classes but
I would be really interested to hear comments about proper/recommended
way of handling for example sessions, request properties, states etc.

Thanks beforehand!

 -Erik


--
Erik Karlsson
erik.karls...@iki.fi

--~--~-~--~~~---~--~~
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] Good way to implement cancel links?

2009-04-04 Thread Clemens Oertel

Hi,

What's the best way to get generic Cancel links into forms, lift- 
style? Assuming that a form can be called from different pages in the  
application, and the cancel link should return to the originating page?
Would it work to have a RequestVar for the target of the cancel link,  
and populate it using the linking page's URI:
SHtml.link(editUrl, () = {...; cancelLinkRV(S.request.uri)},  
Text(Edit))

Is the URI really reusable like this?

Or is there already some better way provided by lift?

Thanks,
Clemens


--~--~-~--~~~---~--~~
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: Newbie problem

2009-04-04 Thread David Pollak
On Sat, Apr 4, 2009 at 2:45 PM, mgm mgm7...@gmail.com wrote:


 That did the trick!

 I apologize for the hubris of a newbie, but I think this is a bug in
 LiftWeb.

 It was getting executed, but I guess with out the declaration, the
 result was not getting implicitly converted from List[Node] to
 NodeSeq.
 The framework was finding  executing the method, but because the
 returned value was not NodeSeq, it did not replace the HTML, I'm
 guessing.

 Lift should check  replace if the result any  Seq[Node], not just
 NodeSeq.

 Should I report this as a bug?


This is not a bug.  There are only so many return types that Lift can check
for... and some get eliminated by type erasure.  So, there's no way to check
if something is a List[Node] without checking each member of the List and
that's a real challenge in the particularly gnarly code that does snippet
dispatch by convention (see net.liftweb.http.LiftSession.scala:724).  The
convention is that the method must return a NodeSeq.  Alternatively, you can
snippet handlers on a page-by-page basis with SiteMap or globally through
LiftRules.





 On Apr 4, 4:26 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
  Change your list def to
 
  def list(xhtml : NodeSeq) : NodeSeq = { ...
 
  If you don't explicitly set the return type to NodeSeq, sometimes things
  don't get properly applied.
 
  Derek
 
  On Sat, Apr 4, 2009 at 2:55 PM, mgm mgm7...@gmail.com wrote:
 
   I added some more debug prints. The list method appears to be doing
   what I expected, though the empty list elements are odd.
 
    AP.scala (extract)
def list(xhtml: NodeSeq) = {
  System.err.println(*** list:  + xhtml)
   val r = Airport.findAll.flatMap(ap = {
System.err.println(ap= + ap)
 bind(ap, xhtml,
 code - ap.code, lat - ap.lattitude, lon -
   ap.longitude)
  })
   System.err.println(*** r= + r)
   r
}
 
    console log ===
   *** list:
  tr
tdap:codeXYZ/ap:code/td
tdap:lat0/ap:lat/td
tdap:lonTo Do/ap:lon/td
  /tr
 
   ap=com.flyspy.bf.model.Airport=
   {id=1,code=ORD,lattitude=50.0,longitude=-60.0}
   ap=com.flyspy.bf.model.Airport=
   {id=2,code=MSP,lattitude=40.0,longitude=-60.0}
   *** r=List(
  , tr
tdORD/td
td50.0/td
td-60.0/td
  /tr,
,
  , tr
tdMSP/td
td40.0/td
td-60.0/td
   /tr,
)
   WARN - Snippet Failure: SnippetFailure(/airports - ParsePath(List
   (airports),,true,false),Full(AP.list),Method Not Found)

 



-- 
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: Good way to implement cancel links?

2009-04-04 Thread David Pollak
S.referer.map(from = SHtml.link(cancel, () = redirectTo(from))) openOr
Text()

On Sat, Apr 4, 2009 at 3:20 PM, Clemens Oertel clemens.oer...@gmail.comwrote:


 Hi,

 What's the best way to get generic Cancel links into forms, lift-
 style? Assuming that a form can be called from different pages in the
 application, and the cancel link should return to the originating page?
 Would it work to have a RequestVar for the target of the cancel link,
 and populate it using the linking page's URI:
 SHtml.link(editUrl, () = {...; cancelLinkRV(S.request.uri)},
 Text(Edit))

 Is the URI really reusable like this?

 Or is there already some better way provided by lift?

 Thanks,
 Clemens


 



-- 
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: Need for lightweight JPA archetype

2009-04-04 Thread bradford

I pasted it here:  http://pastebin.com/m1da32b3

Thanks,
Bradford

On Apr 4, 5:25 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
 If you have a second, could you send the stack trace for the NPE? That's
 definitely not something that should be happening.

 Derek

 On Sat, Apr 4, 2009 at 2:34 PM, bradford fingerm...@gmail.com wrote:

  Yeah, just NetBeans.  It probably makes sense, but everything in
  NetBeans was fine after I did mvn compile; mvn install.  Running the
  app works too.  I did happen to get a NullPointerException when I
  would add a book with no author.  And then again when I would click on
  Book list.  Just an FYI.

  Thanks a lot for the demo and your help.

  Thanks,
  Bradford

  On Apr 4, 3:26 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
   Hmmm. Does maven complain if you try to compile, or is it just NetBeans?

   Derek

   On Sat, Apr 4, 2009 at 9:31 AM, bradford fingerm...@gmail.com wrote:

Hi,

I think I would like to use JPA for my project.  This archetype would
be nice.  Just a second ago I ran mvn archtype:generate on lift-
archetype-jpa-basic.  NetBeans is complaining on 'import
javax.persistence._' not being found in jpatest-spa's Author.scala.
It also complains on 'import org.scala_libs.jpa._' in jpatest-web's
Model.scala.

Thanks,
Bradford

On Apr 3, 4:45 am, Charles F. Munat c...@munat.com wrote:
 No, I meant there were a few candidates for a first commit, not that
 someone else should do it. I have my fingers in a bunch of things at
  the
 moment...

 At the moment, however, I have to pay the bills. But I'll keep
  tinkering.

 Chas.

 Timothy Perrett wrote:
  Probally between yourself and Derek in all honesty - I simply dont
  have the time right now and my lift time and what I do with it
  has
  other investments right now...

  Derek might well be swamped with the book at the moment... so
  perhaps
  there are not so many candidates as you think :-)

  Crack on is what I say - make a branch, knock yourself out and then
  post to the list before merging to master

  Cheers, Tim

  On Apr 2, 7:17 pm, Charles F. Munat c...@munat.com wrote:
  Yup. But there seem to be a few candidates...

  Timothy Perrett wrote:
  Are you eyeing up for your first commit Chas? ;-)
  The src of the JPA archetype is here:

   http://github.com/dpp/liftweb/tree/4a5d4530b407782a2f0e0e99b277432dbb.
  ..
  Cheers, Tim
  On Apr 2, 6:02 pm, Charles F. Munat c...@munat.com wrote:
  Where is the code for these archetypes and how tricky is it to
create them?
  Chas.
--~--~-~--~~~---~--~~
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: Proposed URL Shortening widget

2009-04-04 Thread Chad Skinner

 We do it in ESME.  It's 1 class (the model) and 1 object.


What is ESME?

--~--~-~--~~~---~--~~
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: The Lift 1.1 list

2009-04-04 Thread Chad Skinner


 Also, it would be great it Lift1.1 included all of the
 necessary .js, .css and class files for the new MenuWidget


I have not had the chance to actually work with lift yet and have been doing
a lot of reading, but I have not read how lift currently handles script and
css resources? Does it have a registry that allows resources to be included
in the header and remove duplicate resources or does each widget include the
resources it requires ... possibly multiple times depending on each widgets
requirements?

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---