[Lift] Re: Packaging lift application for distribution

2009-02-02 Thread David Pollak
Thomas,

You can package Lift apps with OneJar and use the Winstone servlet container
(http://winstone.sourceforge.net/ )  That'll put everything in 1 JAR file
and it should allow single-click launch on a Windows machine.

Thanks,

David

On Fri, Jan 30, 2009 at 1:09 PM, Thomas Santana  wrote:

>
> I'm starting to look at lift as an alternative to a Scala+Swing
> application I have. I'll most likely embed Jetty anyway but after
> playing a little with Maven a question came to my mind: How to I
> package a Lift application to be run standalone on a desktop.
>
> My application comes with all the jars it needs (the two scala libs)
> and a couple of scripts to fire it off. I wonder if there is a way to
> build something like this for a Lift application. Something that makes
> easy for someone that is a regular user to get a simple one machine
> install done with a couple of clicks. Any hints?
>
> Thomas
>
> >
>


-- 
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: migration tools?

2009-02-02 Thread Meredith Gregory
Tim,

Thanks for your note. i was largely referring to the possibility of sucking
on the data model (mainly from the db schema side, as the parsing would be
easier) to generate appropriate Model code.

Best wishes,

--greg

On Mon, Feb 2, 2009 at 1:04 PM, Tim Perrett  wrote:

>
>
> Hey Greg,
>
> I have taken great pleasure in porting several "leaking like a rusty
> bucket"
> rails applications... Whilst there is no direct migration, once you
> understand exactly how lift works, it becomes simple.
>
> When you say "db stuff squirted out from ActiveRecord?" - what exactly do
> you mean? Queries? To_xml stuff?
>
> Cheers
>
> Tim
>
> On 02/02/2009 20:53, "Meredith Gregory"  wrote:
>
> > Lifted,
> >
> > Suppose one were to engage in porting a RoR app to a Lift app. Are there
> any
> > tools in the Scala+Lift arsenal that ease that migration? For example, is
> > there a nice path that allows to preserve the db stuff squirted out from
> > ActiveRecord? Is the are way to auto-generate some basic Model code from
> that
> > starting point?
> >
> > More generally, have you guys been thinking about this direction? What
> about
> > migration from other sites?
> >
> > Best wishes,
> >
> > --greg
>
>
>
> >
>


-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
806 55th St NE
Seattle, WA 98105

+1 206.650.3740

http://biosimilarity.blogspot.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: migration tools?

2009-02-02 Thread David Pollak
On Mon, Feb 2, 2009 at 1:04 PM, Tim Perrett  wrote:

>
>
> Hey Greg,
>
> I have taken great pleasure in porting several "leaking like a rusty
> bucket"
> rails applications... Whilst there is no direct migration, once you
> understand exactly how lift works, it becomes simple.
>
> When you say "db stuff squirted out from ActiveRecord?" - what exactly do
> you mean? Queries? To_xml stuff?


I'm guessing that Greg wants a tool that will read the DB scheme and
generate Lift Model classes.  Nothing does that right now, but if someone
wants to contribute such a tool, I'd love it! ;-)


>
>
> Cheers
>
> Tim
>
> On 02/02/2009 20:53, "Meredith Gregory"  wrote:
>
> > Lifted,
> >
> > Suppose one were to engage in porting a RoR app to a Lift app. Are there
> any
> > tools in the Scala+Lift arsenal that ease that migration? For example, is
> > there a nice path that allows to preserve the db stuff squirted out from
> > ActiveRecord? Is the are way to auto-generate some basic Model code from
> that
> > starting point?
> >
> > More generally, have you guys been thinking about this direction? What
> about
> > migration from other sites?
> >
> > Best wishes,
> >
> > --greg
>
>
>
> >
>


-- 
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: migration tools?

2009-02-02 Thread Tim Perrett


Hey Greg,

I have taken great pleasure in porting several "leaking like a rusty bucket"
rails applications... Whilst there is no direct migration, once you
understand exactly how lift works, it becomes simple.

When you say "db stuff squirted out from ActiveRecord?" - what exactly do
you mean? Queries? To_xml stuff?

Cheers

Tim

On 02/02/2009 20:53, "Meredith Gregory"  wrote:

> Lifted,
> 
> Suppose one were to engage in porting a RoR app to a Lift app. Are there any
> tools in the Scala+Lift arsenal that ease that migration? For example, is
> there a nice path that allows to preserve the db stuff squirted out from
> ActiveRecord? Is the are way to auto-generate some basic Model code from that
> starting point?
> 
> More generally, have you guys been thinking about this direction? What about
> migration from other sites?
> 
> Best wishes,
> 
> --greg



--~--~-~--~~~---~--~~
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: liftweb project archetype dependencies

2009-02-02 Thread David Pollak
Ilya,

This is a very helpful observation.

I'm cc'ing the Lift list and perhaps one of the Maven mavens will provide
you with a good answer.

Thanks,

David


On Mon, Feb 2, 2009 at 10:41 AM, Ilya Sergey  wrote:

> Hello, David.
>
> Trying to import new liftweb application project into IntelliJ IDEA via our
> Maven support I figured out that for several artefacts, related to Jetty
> server libraries archetype doesn't contain exact version. That's why our
> embedded maven support (which is actually not our, but we carry these jars
> with IDEA) takes last version of org.mortbay.jetty.* artefact. This version
> is 7.0.0.pre5 and it doesn't contain several important classes, such ase
> org.mortbay.jetty.webapp.WebContext. That's why project, imported to IDEA
> cannot be compiled without some manipulations with libraries and settings.
> So, could you specify this version explicitly in default liftweb
> application Maven project settings.
> Thanks.
>
> Kind regards,
> Ilya Sergey
>



-- 
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] migration tools?

2009-02-02 Thread Meredith Gregory
Lifted,

Suppose one were to engage in porting a RoR app to a Lift app. Are there any
tools in the Scala+Lift arsenal that ease that migration? For example, is
there a nice path that allows to preserve the db stuff squirted out from
ActiveRecord? Is the are way to auto-generate some basic Model code from
that starting point?

More generally, have you guys been thinking about this direction? What about
migration from other sites?

Best wishes,

--greg

-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
806 55th St NE
Seattle, WA 98105

+1 206.650.3740

http://biosimilarity.blogspot.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] Help on getting Eclipse/Maven/Lift working

2009-02-02 Thread Thomas Sant Ana
I followed the tutorial here on this page:

http://scala-blogs.org/2007/12/dynamic-web-applications-with-lift-and.html

And was pleased to see the application come out so quickly. However I have a
question. As I save the file on Eclipse they don't get picked up by Jetty. I
need to do a mvn install on the pom.xml of the eclipse project.  And
clearing the project on eclipse broke mvn install, until I did a mvn clean
then a mvn install.

The tutorial references to "incremental compiling". I've been working with
Scala  on Eclipse and got around most troubles myself. But the
Eclipse+Maven+Jetty+Lift is confusing for me. I have a set of questions:

a) How to get code compile incrementally on eclipse, picked up by jetty?

b) How do I debug the application from eclipse?

c) Is there a way to have it all running under eclipse?

I know these question may seem dumb, but I'm not finding good information on
google. Is there a "Developing for Lift using Eclipse for Dummies" arround?
The best I found what this tutorial.

Thomas

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Menus with Submenus - can I have a top level menu as container only?

2009-02-02 Thread Dano

Did a little more digging into how Loc and MenuItem work together.  It
looks like the 'kids' of a menu item are not exposed until you click
on it.

I am looking to see if we can have behavior which exposes the 'kids'
of a MenuItem before clicking on it.


Dan

On Feb 1, 8:28 pm, Dano  wrote:
> More information on the issue.
>
> My goal is to actually turn the 'vertical' menu stack into a more
> horizontal menu which I can put at the top of the page.  An example
> which illustrates what I am trying to emulate can be seen 
> athttp://www.javascriptkit.com/script/script2/csstopmenu.shtml.  It has
> the behavior I want with respect to the top level menu which has
> submenus (i.e. the top level menu does not redirect, it only shows the
> sub menu items).
>
> Has anyone else tried to do this before?
>
> Thanks in advance.
>
> Dan
>
> On Jan 30, 2:46 pm, Dano  wrote:
>
> > I have an application with a menu which has too many items.  I would
> > like to move some of the menu items into submenus.
>
> > For example, let's say I have menu items called "Client Admin" and
> > "Custom Content" at the top level and I want to put them under a new
> > top level menu item called "Site Admin".  Using the example code from
> > the lift sites sandbox as a guide, the code for this might look
> > something like:
>
> >  Menu(Loc("SiteAdmin", List("site_admin", "index"), "Site Admin",
> > ifIsLoggedIn, ifIsSuperUser),
> >          Menu(Loc("ClientAdmin", List("client_admin", "index"),
> > "Client Mgt", ifIsLoggedIn, ifIsSuperUser)),
> >          Menu(Loc("CustomContent", List("custom_content", "index"),
> > "Custom Content", ifIsLoggedIn, ifIsSuperUser))
> >          ))
>
> > In the above example, the "Site Admin" menu takes you to a new page (/
> > site_admin/index).  However, I really just want to stay on the current
> > page and show the two sub-menu items.
>
> > When I use the current page in the Loc() expression for SiteAdmin, I
> > don't get the sub menu items when I click on "Site Admin".
>
> > Does anyone have a suggestion on how to have the sub-menu items in the
> > above example show when I click on "Site Admin" without requiring that
> > the browser navigate to a new page?
>
> > Many thanks in advance.
>
> > 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: Fwd: [scala] Jane Street Summer Program

2009-02-02 Thread David Pollak
Does anyone have time to find and mentor a student to do Lift work either
through the Jane st or Google Summer of Code programs?

On Feb 2, 2009 10:23 AM, "Jorge Ortiz"  wrote:

If you're a student, Jane Street Capital can give you money to work on
functional programming for a summer...

--j

-- Forwarded message -- From: James Iry 
Date: Mon, Feb 2, 200...

--~--~-~--~~~---~--~~
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: submit and redirect

2009-02-02 Thread Sergey Andreev
There were no errors on the console. And the state was persisted when i was
using Marius's example. So it looks like a bug to me.
Thanks,
Sergey

On Mon, Feb 2, 2009 at 6:09 PM, Tim Perrett  wrote:

>
>
> Lift will still indeed notify you of an error invoking a snippet.
>
> On 02/02/2009 15:01, "Derek Chen-Becker"  wrote:
>
> > Also, if the class for the snippet couldn't be found, Lift should have
> output
> > a message to that effect on the console. If it didn't, then that's a bug.
> >
> > 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] Fwd: [scala] Jane Street Summer Program

2009-02-02 Thread Jorge Ortiz
If you're a student, Jane Street Capital can give you money to work on
functional programming for a summer...

--j

-- Forwarded message --
From: James Iry 
Date: Mon, Feb 2, 2009 at 9:36 AM
Subject: [scala] Jane Street Summer Program
To: Scala list 


This caught my eye and might be interesting to some Scalars out there.  This
year they aren't just focusing on OCaml.

=

The Jane Street Summer Project is aimed at encouraging growth in the
functional programming community by funding students over the summer to work
on open-source projects in various functional programming languages (with a
focus on our favorite language, OCaml). We do that by funding students and
faculty to work together over the summer to create software that makes it
easier for people who are using functional languages as an ends rather than
a means.

The JSSP is funded by Jane Street Capital . We make
extensive use of OCaml at Jane Street , and
it's in our interest to see the FP community thrive. Plus, we think it will
be fun.

For more detailed information, check out the faq!
http://ocaml.janestreet.com/?q=node/57

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

2009-02-02 Thread Michael

I've used Lift quite a bit as REST back end for a Flex/Flash front
end. It is straightforward. Check out Steve Jenson's wiki page on
this: http://liftweb.net/index.php/HowTo_do_Web_Services if you
haven't seen it already. Scala's XML support makes it super easy to
create XML on the server, and E4X makes it easy to consume it on the
client.

I haven't tried Lift with remoting, but this looks promising:
http://flexonrails.net/?p=103 . It might be interesting to create an
AmfActor trait or such to create a tighter integration.

-- Michael

On Feb 1, 12:11 am, Rik  wrote:
> Hi,
>
> As a Scala en Lift newbie I'm wondering about how much interest there
> is to integrate web application written in Scala (Lift?) with Flex.
> After many years developing Java (web) applications I'm convinced that
> creating rich internet applications with HTML/Ajax is not the way to
> go (to be short). Most recent blog about Lift and Flex 
> ishttp://www.gerbrand-ict.nl/2009/01/combining-flex-and-scala-using-lif...
> but it refers to an old post. It surprises me that there is not much
> interest. According to me Flex (view layer) and Scala (server-side) is
> a combination which can go mainstream.
>
> Regards,
> Rik

--~--~-~--~~~---~--~~
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: submit and redirect

2009-02-02 Thread Tim Perrett


Lift will still indeed notify you of an error invoking a snippet.

On 02/02/2009 15:01, "Derek Chen-Becker"  wrote:

> Also, if the class for the snippet couldn't be found, Lift should have output
> a message to that effect on the console. If it didn't, then that's a bug.
> 
> 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: First steps: forms tutorial

2009-02-02 Thread Derek Chen-Becker
For the first error I think you need to import net.liftweb.js.JE._ to get
the implicit String => Str (JsExp) conversion into scope. On the second
error, your code seems to indicate that you're still using the "-->"
operator (I think it's deprecated) instead of "->" (one less dash). Please
fix that and try it again.

Derek

On Sun, Feb 1, 2009 at 11:30 AM, ildella  wrote:

>
> Hi everyone.
>
> I am starting this days to play with lift.
> I am a java developer and I like to use wicket as web framework. I
> would like to try something new so here I am, and I have problems that
> maybe you can help.
>
> I am trying to make the forms tutorial examples to work but I am
> blocked by some compilation error.
> The examples are these ones:
> http://liftweb.net/index.php/Hello_Darwin#my_first_ajax_form
>
> and the compiler tells me that:
>
> [WARNING] /home/della/projects/contrib/sug-it/switter/src/main/scala/
> it/sug/snippet/HelloFormAjax.scala:20: error: type mismatch;
> [WARNING]  found   : java.lang.String("$('#whoField').attr('value')")
> [WARNING]  required: net.liftweb.http.js.JsExp
> [WARNING] "submit" --> {?("Send")} button> % ("onclick" -> ajaxCall("$('#whoField').attr('value')", s =>
> updateWho(s))),
> [WARNING]
> ^
> [WARNING] two errors found
>
> I have tried importing:
> import net.liftweb.http.js._
>
> but nothing changes.
>
> I build the project from mvn archetype and it started with jetty:run
> and I was able to make the helloForm working. But both helloForm2 and
> helloFormAjax have compilation errors.
> HelloForm2 infact give this errors:
>
> [WARNING] /home/della/projects/contrib/sug-it/switter/src/main/scala/
> it/sug/snippet/HelloForm2.scala:14: error: wrong number of parameters;
> expected = 0
> [WARNING]   "submit" --> submit(?("Send"), ignore => {println
> ("value:" + who + " :: " + param("whoField"))}),
>
> >
>

--~--~-~--~~~---~--~~
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: submit and redirect

2009-02-02 Thread Derek Chen-Becker
Also, if the class for the snippet couldn't be found, Lift should have
output a message to that effect on the console. If it didn't, then
*that's*a bug.

Derek

On Mon, Feb 2, 2009 at 8:00 AM, Derek Chen-Becker wrote:

> I think the convention is to either properly capitalize the snippet tag to
> match the class name, as you've done, or to use underscores to indicate
> camel case, a la
>
> show_market
>
> I don't think that Lift handles "mixed" camel case, but it's been a while
> since I've looked at that part of the code.
>
> Derek
>
>
> On Sun, Feb 1, 2009 at 9:20 AM, Sergey Andreev wrote:
>
>> The problem has nothing to do with templates names.
>> I was writting ...
>>
>> Capitalizing the first letter in the snippet's name
>> () solved the problem. Anyway looks like a bug =)
>>
>> Regards,
>> Sergey
>>
>>
>>
>> On Sun, Feb 1, 2009 at 7:09 PM, Sergey Andreev wrote:
>>
>>> Derek,
>>> I was commenting out everything from my snippet and template but still
>>> the state was lossing between after redirect. And then i decided to change
>>> the name of the template from "index.html" to "add.html" (any other name)
>>> and it magically worked. Looks like a bug to me. Will investigate the
>>> sources further.
>>> Thanks for your help,
>>> Sergey
>>>
>>> On Fri, Jan 30, 2009 at 11:44 PM, Derek Chen-Becker <
>>> dchenbec...@gmail.com> wrote:
>>>
 Right, really the same mechanism in different guises. Still, the code
 that Sergey sent should work as far as I can tell...

 Derek


 On Fri, Jan 30, 2009 at 11:01 AM, Marius wrote:

>
> Yeah it does... in essence not very different from initial proposal
> since internally redirectTo from stateful snippet does the same thing:
> binds a function to be executed upon redirect.
>
> On Jan 30, 5:47 pm, Derek Chen-Becker  wrote:
> > Unless I'm missing something the stateful snippet should be working.
> The
> > this.redirectTo call should be invoking the StatefulSnippet's
> redirectTo,
> > which should associate the same snippet instance with the new page.
> That
> > should allow access to the same var. I just coded up a test app
> (attached)
> > and it works fine using very similar code.
> >
> > On Fri, Jan 30, 2009 at 12:36 AM, Marius 
> wrote:
> >
> > > On Jan 29, 10:54 pm, Sergey Andreev  wrote:
> > > > Hi Liftlers,
> > > > I am migrating one of my application to the lift as a way to
> learn it and
> > > i
> > > > would like to ask a question.
> >
> > > > After submitting a form i would like to do a redirect and show
> the
> > > submitted
> > > > values on the other template. I have 2 templates and i use the
> same
> > > snippet
> > > > in both of them to render a dynamic content.
> > > > As far as i understand there are 2 ways to make it work: saving
> state
> > > using
> > > > SessionVars(which works for me) or extending StatefulSnippet and
> calling
> > > > this.redirectTo on it (looking at the sources it should register
> the
> > > > stateful snippet in the session). I've tried extending
> StatefulSnippet
> > > but
> > > > it doesn't work for me. A hashed value is added to the redirect
> url which
> > > > should map to the stateful snippet but the state is lost. I don't
> > > understand
> > > > what i am doing wrong.
> >
> > > > The simplified example of the code:
> >
> > > > class MySnippet extend StatefulSnippet {
> > > >   private var myValues: List[String] = List()
> >
> > > >   val dispatch.. = {
> > > > case "save" => save_
> > > > case "show" => show _
> > > >   }
> >
> > > >   def show = {
> > > > myValues.foreach(Log.info(_)) //nothing here
> > > >   }
> >
> > > >   def save(xhtml: NodeSeq) : NodeSeq = {
> > > > def processForm = {
> > > >   myValues.foreach(Log.info(_)) //submitted values are
> printed out
> > > >   this.redirectTo("/show")
> > > > }
> >
> > > Unless I'm missing something I do not this your values can be shown
> in
> > > the new template. There is an overloaded S.redirectTo where you can
> > > specify a function to be executed when the redirect is receives.
> Hence
> > > here you can pass state. See
> >
> > > def redirectTo[T](where: String, func: () => Unit): T
> >
> > > In this function you could probably set some RequestVar holding
> your
> > > needed state and when you snippet is rendered in the /show page you
> > > just read the info from these RequestVar(s).
> >
> > > > bind("render", xhtml,
> > > >.. //render textboxes and register functions which add
> values
> > > to
> > > > the myValues list
> > > >"submit" -> submit("Submit", processForm)
> > > >   }
> >
> > > > }
> >
> > > > Tha

[Lift] Re: submit and redirect

2009-02-02 Thread Derek Chen-Becker
I think the convention is to either properly capitalize the snippet tag to
match the class name, as you've done, or to use underscores to indicate
camel case, a la

show_market

I don't think that Lift handles "mixed" camel case, but it's been a while
since I've looked at that part of the code.

Derek

On Sun, Feb 1, 2009 at 9:20 AM, Sergey Andreev  wrote:

> The problem has nothing to do with templates names.
> I was writting ...
>
> Capitalizing the first letter in the snippet's name
> () solved the problem. Anyway looks like a bug =)
>
> Regards,
> Sergey
>
>
>
> On Sun, Feb 1, 2009 at 7:09 PM, Sergey Andreev wrote:
>
>> Derek,
>> I was commenting out everything from my snippet and template but still the
>> state was lossing between after redirect. And then i decided to change the
>> name of the template from "index.html" to "add.html" (any other name) and it
>> magically worked. Looks like a bug to me. Will investigate the sources
>> further.
>> Thanks for your help,
>> Sergey
>>
>> On Fri, Jan 30, 2009 at 11:44 PM, Derek Chen-Becker <
>> dchenbec...@gmail.com> wrote:
>>
>>> Right, really the same mechanism in different guises. Still, the code
>>> that Sergey sent should work as far as I can tell...
>>>
>>> Derek
>>>
>>>
>>> On Fri, Jan 30, 2009 at 11:01 AM, Marius wrote:
>>>

 Yeah it does... in essence not very different from initial proposal
 since internally redirectTo from stateful snippet does the same thing:
 binds a function to be executed upon redirect.

 On Jan 30, 5:47 pm, Derek Chen-Becker  wrote:
 > Unless I'm missing something the stateful snippet should be working.
 The
 > this.redirectTo call should be invoking the StatefulSnippet's
 redirectTo,
 > which should associate the same snippet instance with the new page.
 That
 > should allow access to the same var. I just coded up a test app
 (attached)
 > and it works fine using very similar code.
 >
 > On Fri, Jan 30, 2009 at 12:36 AM, Marius 
 wrote:
 >
 > > On Jan 29, 10:54 pm, Sergey Andreev  wrote:
 > > > Hi Liftlers,
 > > > I am migrating one of my application to the lift as a way to learn
 it and
 > > i
 > > > would like to ask a question.
 >
 > > > After submitting a form i would like to do a redirect and show the
 > > submitted
 > > > values on the other template. I have 2 templates and i use the
 same
 > > snippet
 > > > in both of them to render a dynamic content.
 > > > As far as i understand there are 2 ways to make it work: saving
 state
 > > using
 > > > SessionVars(which works for me) or extending StatefulSnippet and
 calling
 > > > this.redirectTo on it (looking at the sources it should register
 the
 > > > stateful snippet in the session). I've tried extending
 StatefulSnippet
 > > but
 > > > it doesn't work for me. A hashed value is added to the redirect
 url which
 > > > should map to the stateful snippet but the state is lost. I don't
 > > understand
 > > > what i am doing wrong.
 >
 > > > The simplified example of the code:
 >
 > > > class MySnippet extend StatefulSnippet {
 > > >   private var myValues: List[String] = List()
 >
 > > >   val dispatch.. = {
 > > > case "save" => save_
 > > > case "show" => show _
 > > >   }
 >
 > > >   def show = {
 > > > myValues.foreach(Log.info(_)) //nothing here
 > > >   }
 >
 > > >   def save(xhtml: NodeSeq) : NodeSeq = {
 > > > def processForm = {
 > > >   myValues.foreach(Log.info(_)) //submitted values are printed
 out
 > > >   this.redirectTo("/show")
 > > > }
 >
 > > Unless I'm missing something I do not this your values can be shown
 in
 > > the new template. There is an overloaded S.redirectTo where you can
 > > specify a function to be executed when the redirect is receives.
 Hence
 > > here you can pass state. See
 >
 > > def redirectTo[T](where: String, func: () => Unit): T
 >
 > > In this function you could probably set some RequestVar holding your
 > > needed state and when you snippet is rendered in the /show page you
 > > just read the info from these RequestVar(s).
 >
 > > > bind("render", xhtml,
 > > >.. //render textboxes and register functions which add
 values
 > > to
 > > > the myValues list
 > > >"submit" -> submit("Submit", processForm)
 > > >   }
 >
 > > > }
 >
 > > > Thanks,
 > > > Sergey
 > > > P.S. The more i learn about Lift the more i like it. Thank you
 David and
 > > all
 > > > lift committers!!!
 >
 >
 >
 >  teststateful.tgz
 > 7KViewDownload


>>>
>>>
>>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google G

Re: Fwd: [Lift] Cleaning up warnings

2009-02-02 Thread etorreborre

Hi David and Rickard,

If you replace property(...) by Prop.forAll(...), the warnings should
disappear.

On the other hand I don't know why forAll(...) only doesn't work.

Cheers,

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



Re: Fwd: [Lift] Cleaning up warnings

2009-02-02 Thread Rickard Nilsson

It seems strange that forAll complains about getting a String => Boolean
function. It works fine in the interpreter. The only reason I can see for
that error message is that Scala somehow thinks that forAll is given two
parameter lists. There exists an overloaded version of forAll of type
[T](Gen[T)(T => Prop) => Prop.

I can try to check out the Lift code and investigate the warnings when  
I get some time for it.

   / Rickard

Quoting Jorge Ortiz :

> (Forwarding to Scalacheck list.)
>
> If I recall correctly these warnings showed up when I upgraded us to 2.7.2
> and the corresponding version of Scalacheck. I couldn't make them go away
> either.
>
> --j
>
> -- Forwarded message --
> From: David Pollak 
> Date: Sat, Jan 31, 2009 at 8:31 PM
> Subject: [Lift] Cleaning up warnings
> To: liftweb 
>
>
> Folks,
> I've been trying to clean up warnings in the Lift code.  I tried to change
> Prop.property to Prop.forAll as ScalaCheck has deprecated property, but the
> compiler complained the a String => Boolean was not a Gen.  Anybody have a
> clue how to make these warning go away:
> [WARNING]
> C:\Users\dpp\Documents\liftweb\lift-util\src\test\scala\net\liftweb\ut
> il\BoxUnit.scala:38: warning: method property in object Prop is deprecated
> [WARNING]   property(equality) must pass
> [WARNING]   ^
> [WARNING]
> C:\Users\dpp\Documents\liftweb\lift-util\src\test\scala\net\liftweb\ut
> il\CombParserHelpersSpec.scala:52: warning: method property in object Prop
> is de
> precated
> [WARNING]   property(whiteParse) must pass
> [WARNING]   ^
> [WARNING]
> C:\Users\dpp\Documents\liftweb\lift-util\src\test\scala\net\liftweb\ut
> il\CombParserHelpersSpec.scala:60: warning: method property in object Prop
> is de
> precated
> [WARNING]   property(whiteSpaceParse) must pass
> [WARNING]   ^
> [WARNING]
> C:\Users\dpp\Documents\liftweb\lift-util\src\test\scala\net\liftweb\ut
> il\CombParserHelpersSpec.scala:69: warning: method property in object Prop
> is de
> precated
> [WARNING]   property(ignoreCaseStringParse) must pass
> [WARNING]   ^
> [WARNING]
> C:\Users\dpp\Documents\liftweb\lift-util\src\test\scala\net\liftweb\ut
> il\CombParserHelpersSpec.scala:77: warning: method property in object Prop
> is de
> precated
> [WARNING]   property(isDigit) must pass
> [WARNING]   ^
> [WARNING]
> C:\Users\dpp\Documents\liftweb\lift-util\src\test\scala\net\liftweb\ut
> il\CombParserHelpersSpec.scala:86: warning: method property in object Prop
> is de
> precated
> [WARNING]   property(number) must pass
> [WARNING]   ^
> [WARNING]
> C:\Users\dpp\Documents\liftweb\lift-util\src\test\scala\net\liftweb\ut
> il\CombParserHelpersSpec.scala:119: warning: method property in object Prop
> is d
> eprecated
> [WARNING]   property((s: String) => (!stringWrapper(s).isEmpty) ==>
> permuteA
> llParsers(s)) must pass
> [WARNING]   ^
> [WARNING]
> C:\Users\dpp\Documents\liftweb\lift-util\src\test\scala\net\liftweb\ut
> il\CombParserHelpersSpec.scala:124: warning: method property in object Prop
> is d
> eprecated
> [WARNING]   property((s: String) => (!stringWrapper(s).isEmpty) ==>
> repNNPar
> ser(s)) must pass
> [WARNING]   ^
> [WARNING] 10 warnings found
>
> Thanks,
>
> David
>
> --
> 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
-~--~~~~--~~--~--~---