[Lift] Where to add demos/examples

2009-05-02 Thread Heiko Seeberger
Hi,
I would like to add demo/example (well, also POC) projects to the
repository. Where would be the right place?

1. Into the repository root
2. Into a lift-examples module
3. Other alternatives?

I think I would like to go for lift-examples and maybe have nested modules
there, e.g.
lift-examples
  lift-examples-osgi
lift-examples-osgi-hello
...

What do you think?

Heiko
-- 
www.heikoseeberger.name
OSGi on Scala: www.scalamodules.org
Lift, the simply functional web framework: http://liftweb.net

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



[Lift] Re: Where to add demos/examples

2009-05-02 Thread Oliver Lambert
Interesting idea, perhaps you could get the examples hosted on the lift demo
website too.
Oliver

On Sat, May 2, 2009 at 7:48 PM, Heiko Seeberger <
heiko.seeber...@googlemail.com> wrote:

> Hi,
> I would like to add demo/example (well, also POC) projects to the
> repository. Where would be the right place?
>
> 1. Into the repository root
> 2. Into a lift-examples module
> 3. Other alternatives?
>
> I think I would like to go for lift-examples and maybe have nested modules
> there, e.g.
> lift-examples
>   lift-examples-osgi
> lift-examples-osgi-hello
> ...
>
> What do you think?
>
> Heiko
> --
> www.heikoseeberger.name
> OSGi on Scala: www.scalamodules.org
> Lift, the simply functional web framework: http://liftweb.net
>
> >
>

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



[Lift] Re: Where to add demos/examples

2009-05-02 Thread Timothy Perrett


Heiko,

Please see here: http://is.gd/w5SB

We've talked before on the committers list about renaming sites to
"examples" or such, so I see no reason why putting any working example you
want in there. POC would probably be a different matter... If its not
working code, host it on your own github account then when its working
potentially move it into examples if appropriate.

Cheers, Tim



On 02/05/2009 12:53, "Oliver Lambert"  wrote:

> Interesting idea, perhaps you could get the examples hosted on the lift demo
> website too. 
> 
> Oliver
> 
> On Sat, May 2, 2009 at 7:48 PM, Heiko Seeberger
>  wrote:
>> Hi,
>> 
>> I would like to add demo/example (well, also POC) projects to the repository.
>> Where would be the right place?
>> 
>> 1. Into the repository root
>> 2. Into a lift-examples module
>> 3. Other alternatives?
>> 
>> I think I would like to go for lift-examples and maybe have nested modules
>> there, e.g.
>> lift-examples
>>   lift-examples-osgi
>>     lift-examples-osgi-hello
>>     ...
>> 
>> What do you think?
>> 
>> Heiko



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



[Lift] Re: Where to add demos/examples

2009-05-02 Thread David Pollak
On Sat, May 2, 2009 at 5:09 AM, Timothy Perrett wrote:

>
>
> Heiko,
>
> Please see here: http://is.gd/w5SB
>

+1


>
> We've talked before on the committers list about renaming sites to
> "examples" or such, so I see no reason why putting any working example you
> want in there. POC would probably be a different matter... If its not
> working code, host it on your own github account then when its working
> potentially move it into examples if appropriate.
>
> Cheers, Tim
>
>
>
> On 02/05/2009 12:53, "Oliver Lambert"  wrote:
>
> > Interesting idea, perhaps you could get the examples hosted on the lift
> demo
> > website too.
> >
> > Oliver
> >
> > On Sat, May 2, 2009 at 7:48 PM, Heiko Seeberger
> >  wrote:
> >> Hi,
> >>
> >> I would like to add demo/example (well, also POC) projects to the
> repository.
> >> Where would be the right place?
> >>
> >> 1. Into the repository root
> >> 2. Into a lift-examples module
> >> 3. Other alternatives?
> >>
> >> I think I would like to go for lift-examples and maybe have nested
> modules
> >> there, e.g.
> >> lift-examples
> >>   lift-examples-osgi
> >> lift-examples-osgi-hello
> >> ...
> >>
> >> What do you think?
> >>
> >> Heiko
>
>
>
> >
>


-- 
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: Where to add demos/examples

2009-05-02 Thread Oliver Lambert
Oh dear, sorry didn't realize I was butting in on committers talk.

On Sat, May 2, 2009 at 11:20 PM, David Pollak  wrote:

>
>
> On Sat, May 2, 2009 at 5:09 AM, Timothy Perrett 
> wrote:
>
>>
>>
>> Heiko,
>>
>> Please see here: http://is.gd/w5SB
>>
>
> +1
>
>
>>
>> We've talked before on the committers list about renaming sites to
>> "examples" or such, so I see no reason why putting any working example you
>> want in there. POC would probably be a different matter... If its not
>> working code, host it on your own github account then when its working
>> potentially move it into examples if appropriate.
>>
>> Cheers, Tim
>>
>>
>>
>> On 02/05/2009 12:53, "Oliver Lambert"  wrote:
>>
>> > Interesting idea, perhaps you could get the examples hosted on the lift
>> demo
>> > website too.
>> >
>> > Oliver
>> >
>> > On Sat, May 2, 2009 at 7:48 PM, Heiko Seeberger
>> >  wrote:
>> >> Hi,
>> >>
>> >> I would like to add demo/example (well, also POC) projects to the
>> repository.
>> >> Where would be the right place?
>> >>
>> >> 1. Into the repository root
>> >> 2. Into a lift-examples module
>> >> 3. Other alternatives?
>> >>
>> >> I think I would like to go for lift-examples and maybe have nested
>> modules
>> >> there, e.g.
>> >> lift-examples
>> >>   lift-examples-osgi
>> >> lift-examples-osgi-hello
>> >> ...
>> >>
>> >> What do you think?
>> >>
>> >> Heiko
>>
>>
>>
>>
>>
>
>
> --
> 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: Where to add demos/examples

2009-05-02 Thread Timothy Perrett

Your not - dont worry ;-)

On May 2, 2:49 pm, Oliver Lambert  wrote:
> Oh dear, sorry didn't realize I was butting in on committers talk.

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



[Lift] Re: Where to add demos/examples

2009-05-02 Thread David Pollak
On Sat, May 2, 2009 at 6:51 AM, Timothy Perrett wrote:

>
> Your not - dont worry ;-)
>

Heiko posted this to the main list because committers talk is only
scheduling related stuff.  Everything else is out in the open.  If folks
think that the examples should go someplace else, by all means speak up.
 We're building Lift for the community and hearing your voices helps us do
the best that we can.  With that being said, we're a very vocal bunch... the
top posters to this list on any given month are committers... so we just
can't shut up :-)



>
> On May 2, 2:49 pm, Oliver Lambert  wrote:
> > Oh dear, sorry didn't realize I was butting in on committers talk.
>
> >
>


-- 
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: Where to add demos/examples

2009-05-02 Thread Timothy Perrett

> With that being said, we're a very vocal bunch... the
> top posters to this list on any given month are committers... so we just
> can't shut up :-)

Guilty as charged! lol.

I think thats a real positive thing though - it means lots of
community members get lots of help / talk / general lift-related
anecdotes! Bar this message, the signal to noise ratio is generally
very high :-)

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: how to add object into session scope in lift

2009-05-02 Thread David Pollak
On Thu, Apr 30, 2009 at 10:48 PM, Andrew Scherpbier
wrote:

>
> The "Getting Started" document got me hooked on Lift.  :-)
> I guess I'll report my struggles from there.  I don't know if what I did
> is typical.
>
> After actually running the two examples from the "Getting Started" docs,
> I looked and found some other examples, did some looking around in the
> mailing list archives and started reading the "Exploring Lift" book.
> As a starting application of lift, I want to write a simple purchase
> order tracking webapp.  It was easy enough to figure out how to hook up
> PostgreSQL instead of Derby.  I started experimenting with the CRUDify
> trait and got several tables working, but then I got stuck trying to
> make a more cohesive app.  What I could not figure out was how to use
> CRUDify's functionality without having to put all the options in the
> SiteMap.  So I spent a lot of time trying to figure out the SiteMap
> class.  I have since come to the realization that I probably shouldn't
> be using CRUDify, as non of the examples actually use it.  I have also
> realized that I should be putting rules in LiftRules.rewrite.
>

I don't think so.  I think that you should be using SiteMap.  SiteMap is the
best tool for defining site navigation and access control rules around.

CRUDify and ProtoUser are like scaffolding... they get you some pieces
really quickly, but you'll ultimately need to replace them.  You should
never have to replace SiteMap.

So... what's the specific challenge you're running into with SiteMap?


>
> So, my point, I guess, is that it was never clear to me what request
> rewriting was all about.  I didn't understand the explanations and
> basically just skipped it and tried to do everything with SiteMap.
> What I have taken away from this:  "Request Rewriting" sounds very
> advanced and made me think of sendmail rewriting rules!  (Yuck!)
> Maybe it would be good to have some blurbs on "Lift for JEE
> developers".  What is the equivalent of mapping a URL to a servlet and
> how do you deal with the URL pattern matching.  (I want to map "/foo/*"
> to a some soft of action)
>
> So that would then be a nice lead-in to coverage of net.liftweb.http.S,
> right?
>
> Anyway, back to API docs, it never occurred to be to look at the docs
> for net.liftweb.http.LiftRules!  There are actually lots of comments
> there.  The "rewrite" is kinda hidden there, so it probably should be
> called out in the class docs.  Then for the actual "rewrite" docs, it
> would be nice to give some examples of what should go in there or
> provide a link to external docs showing the same.
>
> How have other people tackled the learning curve of lift?
>
> --Andrew
>
> Derek Chen-Becker wrote:
> > In terms of the API docs part of it would just be expanding on the
> > current scaladoc to provider better explanation. Obviously there are a
> > ton of classes to document, so I'd like to focus efforts on getting
> > the most bang for the buck. I was thinking of starting with
> > net.liftweb.http.{LiftRules,S,SHtml} and making the documentation on
> > them *outstanding*. We can branch out from there. If you're coming to
> > Lift new, it would also be helpful to find out what we're missing or
> > need to cover better in the "Getting Started" document on the web
> > site. If you want to read through that and provide feedback here on
> > the list that would be great.
> >
> > Derek
> >
> > On Thu, Apr 30, 2009 at 12:20 PM, Andrew Scherpbier
> > mailto:and...@scherpbier.org>> wrote:
> >
> >
> > Derek,
> > That's awesome.  I want to help.  What can I do?  I can start by
> proof
> > reading stuff.
> >
> > --Andrew
> >
>
>
> >
>


-- 
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] objet vs class for snippets

2009-05-02 Thread Timothy Perrett

Guys,

I noticed that the internal lift snippets (msgs et al) have been moved
to objects rather than classes - there are obvious benefits
performance wise for this, but what should we be supplying to new-
comers as the de-facto snippet implementation style? I know the answer
is unlikely to be clean cut, but perhaps we should document the pros /
cons of both approaches?

Thanks, 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] scalajpa 1.1

2009-05-02 Thread TSP

Question for Derek
my jpa 1.1-SNAPSHOT version seems to have disappeared from the maven
repo to be replaced with 1.1
But at the same time now I've done a maven clean  it looks like
RequestVarEM doesn't exist any more. I just got the source from git
and this seems to be the case. So what do I do with that bit of the
model (or are you busy rewriting that section of the book right
now ...)?
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: scalajpa 1.1

2009-05-02 Thread Derek Chen-Becker
My apologies. We had to move RequestVarEM to the lift-jpa module in order to
fix a circular dependency that was preventing Lift 1.1-M1 from going out. If
you're using Lift 1.0 then you should really be using ScalaJPA 1.0.
Otherwise, you need to use the lift-jpa module instead of scalajpa with the
following dependency:


  net.liftweb
  lift-jpa
  1.1-M1


The RequestVarEM trait also moved to the net.liftweb.jpa package, so you'll
need to modify that. Everything else in ScalaJPA stayed where it is. I'll
update the book.

Derek

On Sat, May 2, 2009 at 9:23 AM, TSP  wrote:

>
> Question for Derek
> my jpa 1.1-SNAPSHOT version seems to have disappeared from the maven
> repo to be replaced with 1.1
> But at the same time now I've done a maven clean  it looks like
> RequestVarEM doesn't exist any more. I just got the source from git
> and this seems to be the case. So what do I do with that bit of the
> model (or are you busy rewriting that section of the book right
> now ...)?
> 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] Lift 1.1 M1 question

2009-05-02 Thread TSP

I'm at early stages of a fairly big project at the moment and mainly
working in my domain model. Is M1 safe to use, since I doubt we'll get
onto serious UI stuff for at least a month and production is likely
2-3 months after that.
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 1.1 M1 question

2009-05-02 Thread Timothy Perrett


Tim,

.m1 is indeed stable to use, go right ahead :)

Cheers, Timothy

On 02/05/2009 16:50, "TSP"  wrote:

> 
> I'm at early stages of a fairly big project at the moment and mainly
> working in my domain model. Is M1 safe to use, since I doubt we'll get
> onto serious UI stuff for at least a month and production is likely
> 2-3 months after that.
> 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] stuck on some scala while using jpa

2009-05-02 Thread TSP

Hi,
I'm confused about some scala, which isn't behaving as expected

My code is:

  override def postcodesForSector(sector: PostalSector) = {
// getEm.flatMap(_.createNamedQuery[Postcode]
("findPostcodesForSector", ("sector" -> sector + "%")))
val likeString = sector.name + "%"
//val query = getEm.createNamedQuery[Postcode]
("findPostcodesForSector", "sector" -> likeString)
//query.findAll
getEm.findAll[Postcode]("findPostcodesForSector", "sector" ->
likeString)
  }

 getEm returns a ScalaEntityManager

the override is overriding the trait method declaration
  def postcodesForSector(sector: PostalSector) : List[Postcode]




But I'm getting a compiler error
C:\programmingExperiments\scala\domains\JPADemo\src\main\scala\uk\co
\optrak\infrastructure\repository\addresses\uk
\PostcodeRepositoryImpl.scala:28: error: type mismatch;
[WARNING]  found   : java.lang.Object with
scala.collection.jcl.BufferWrapper
[uk.co.optrak.scdomain.addresses.uk.Postcode]
[WARNING]  required: List[uk.co.optrak.scdomain.addresses.uk.Postcode]

I'm using scalajpa 1.1 which says that the findAll method should
return List[A] not ..BufferWrapper[A]

Any suggestions
Thanks
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] buttons and textbox

2009-05-02 Thread Meredith Gregory
Lifted,

i'm putting together a little lift-based testharness in which to evaluate
various solutions to the challenge Martin posted recently regarding scalable
abstractions for a little lambda interpreter. You can get a copy of the app
here . (Please note:
this is a testharness and not a proposed solution. i've got a couple of
solutions in mind, but before i post them, i'd like to put them in a web
"container".) As usual, i'm running into problems on the frontend. i'm not
getting expected callback behavior, and, moreover, the code i'm using used
to work fine.

The snippet code is included below this email's closing. The relevant
fragment is listed just below. The behavior i see is that the button
produces no behavior on the server at all. The CR/LF event on the text field
causes updateWhat to be called twice. Any advice on the frontend behavior
would be greatly appreciated.

def whatNode(termStr : String) = {
theTerm = termStr
theClientRequestStr = evalStr()
var theParseResponseStr : String =
  ("failure: " + theClientRequestStr + "\n");
try {
  theParseResponseStr =
theREPL.showClientRequestParseTree(theClientRequestStr)
  println( "parsed : " + theParseResponseStr );
//theREPL.readEvalPrint(theClientRequestStr)
}
catch {
  case e => {
val sw : java.io.StringWriter =new java.io.StringWriter( );
e.printStackTrace( new java.io.PrintWriter( sw, true ) );
theParseResponseStr = theParseResponseStr + e.toString
  }
}
{theParseResponseStr}
  }

  def updateWhat(str: String): JsCmd = {
println("updateWhat with " + str)
JsCmds.SetHtml("parseTree", whatNode(str))
  }

  def show(xhtml: NodeSeq): NodeSeq = {

  Term :
  { text("lambda x.x", (updateWhat _)) % ("size" -> "60") % ("id" ->
"whatField") }
  { {?("Go")} %
   ("onclick" -> ajaxCall(JsRaw("$('#whatField').attr('value')"), s =>
updateWhat(s))) }
  
  {whatNode(evalStr())}

  }

Best wishes,

--greg

package com.biosimilarity.reflection.snippet

import net.liftweb._
import http._
import S._
import SHtml._
import util._
import Helpers._
import mapper._
import textile._
import js.{JE, JsCmd, JsCmds}
import JsCmds._
import JE._

import com.biosimilarity.reflection.model.REPL

import scala.xml._

class REPLForm {
  val theREPL = new REPL()
  var theTerm : String = "lambda x.x"
  var theClientRequestStr : String = evalStr()

  def evalStr() = theTerm
  def clientRequestRequest() = theClientRequestStr

  def parseTreeNode(clientRequestStr : String) = {
theClientRequestStr = clientRequestStr.replace( "\n", "" );
var theParseResponseStr : String =
  ( "failure: " + theClientRequestStr + "\n" );
try {
  theParseResponseStr =
theREPL.showClientRequestParseTree(theClientRequestStr)
//theREPL.readEvalPrint(theClientRequestStr)
}
catch {
  case e => {
val sw : java.io.StringWriter =new java.io.StringWriter( );
e.printStackTrace( new java.io.PrintWriter( sw, true ) );
theParseResponseStr = theParseResponseStr + e.toString
  }
}
{theParseResponseStr}
  }

  def whatNode(termStr : String) = {
theTerm = termStr
theClientRequestStr = evalStr()
var theParseResponseStr : String =
  ("failure: " + theClientRequestStr + "\n");
try {
  theParseResponseStr =
theREPL.showClientRequestParseTree(theClientRequestStr)
  println( "parsed : " + theParseResponseStr );
//theREPL.readEvalPrint(theClientRequestStr)
}
catch {
  case e => {
val sw : java.io.StringWriter =new java.io.StringWriter( );
e.printStackTrace( new java.io.PrintWriter( sw, true ) );
theParseResponseStr = theParseResponseStr + e.toString
  }
}
{theParseResponseStr}
  }

  def updateWhat(str: String): JsCmd = {
println("updateWhat with " + str)
JsCmds.SetHtml("parseTree", whatNode(str))
  }

  def show(xhtml: NodeSeq): NodeSeq = {

  Term :
  { text("lambda x.x", (updateWhat _)) % ("size" -> "60") % ("id" ->
"whatField") }
  { {?("Go")} %
   ("onclick" -> ajaxCall(JsRaw("$('#whatField').attr('value')"), s =>
updateWhat(s))) }
  
  {whatNode(evalStr())}

  }
}


-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
1219 NW 83rd St
Seattle, WA 98117

+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: buttons and textbox

2009-05-02 Thread Meredith Gregory
Lifted,

When i look at the button behavior using firebug, this is the following
error i see.

F891109765602PT1 is not defined
onclick(click clientX=950, clientY=152)1tbfBLwe...6bg%3D%3D (line 2)
(F891109765602PT1, lift_ajaxHand...whatField").attr("value"), null, null));

It would appear that however the

ajaxCall(JsRaw("$('#whatField').attr('value')")

is working it is setting up a handle that is stale by the time the behavior
is actually invoked. This is behind-the-scenes stuff for a programmer like
me. It's part of what lift is s'posed to provide. Moreover, i get no help
from the compiler. The code i have written is well-typed. Any help would be
greatly appreciated.

Best wishes,

--greg


On Sat, May 2, 2009 at 8:50 PM, Meredith Gregory
wrote:

> Lifted,
>
> i'm putting together a little lift-based testharness in which to evaluate
> various solutions to the challenge Martin posted recently regarding scalable
> abstractions for a little lambda interpreter. You can get a copy of the app
> here . (Please note:
> this is a testharness and not a proposed solution. i've got a couple of
> solutions in mind, but before i post them, i'd like to put them in a web
> "container".) As usual, i'm running into problems on the frontend. i'm not
> getting expected callback behavior, and, moreover, the code i'm using used
> to work fine.
>
> The snippet code is included below this email's closing. The relevant
> fragment is listed just below. The behavior i see is that the button
> produces no behavior on the server at all. The CR/LF event on the text field
> causes updateWhat to be called twice. Any advice on the frontend behavior
> would be greatly appreciated.
>
> def whatNode(termStr : String) = {
> theTerm = termStr
> theClientRequestStr = evalStr()
> var theParseResponseStr : String =
>   ("failure: " + theClientRequestStr + "\n");
> try {
>   theParseResponseStr =
> theREPL.showClientRequestParseTree(theClientRequestStr)
>   println( "parsed : " + theParseResponseStr );
> //theREPL.readEvalPrint(theClientRequestStr)
> }
> catch {
>   case e => {
> val sw : java.io.StringWriter =new java.io.StringWriter( );
> e.printStackTrace( new java.io.PrintWriter( sw, true ) );
> theParseResponseStr = theParseResponseStr + e.toString
>   }
> }
> {theParseResponseStr}
>   }
>
>   def updateWhat(str: String): JsCmd = {
> println("updateWhat with " + str)
> JsCmds.SetHtml("parseTree", whatNode(str))
>   }
>
>   def show(xhtml: NodeSeq): NodeSeq = {
> 
>   Term :
>   { text("lambda x.x", (updateWhat _)) % ("size" -> "60") % ("id" ->
> "whatField") }
>   { {?("Go")} %
>("onclick" -> ajaxCall(JsRaw("$('#whatField').attr('value')"), s =>
> updateWhat(s))) }
>   
>   {whatNode(evalStr())}
> 
>   }
>
> Best wishes,
>
> --greg
>
> package com.biosimilarity.reflection.snippet
>
> import net.liftweb._
> import http._
> import S._
> import SHtml._
> import util._
> import Helpers._
> import mapper._
> import textile._
> import js.{JE, JsCmd, JsCmds}
> import JsCmds._
> import JE._
>
> import com.biosimilarity.reflection.model.REPL
>
> import scala.xml._
>
> class REPLForm {
>   val theREPL = new REPL()
>   var theTerm : String = "lambda x.x"
>   var theClientRequestStr : String = evalStr()
>
>   def evalStr() = theTerm
>   def clientRequestRequest() = theClientRequestStr
>
>   def parseTreeNode(clientRequestStr : String) = {
> theClientRequestStr = clientRequestStr.replace( "\n", "" );
> var theParseResponseStr : String =
>   ( "failure: " + theClientRequestStr + "\n" );
> try {
>   theParseResponseStr =
> theREPL.showClientRequestParseTree(theClientRequestStr)
> //theREPL.readEvalPrint(theClientRequestStr)
> }
> catch {
>   case e => {
> val sw : java.io.StringWriter =new java.io.StringWriter( );
> e.printStackTrace( new java.io.PrintWriter( sw, true ) );
> theParseResponseStr = theParseResponseStr + e.toString
>   }
> }
> {theParseResponseStr}
>   }
>
>   def whatNode(termStr : String) = {
> theTerm = termStr
> theClientRequestStr = evalStr()
> var theParseResponseStr : String =
>   ("failure: " + theClientRequestStr + "\n");
> try {
>   theParseResponseStr =
> theREPL.showClientRequestParseTree(theClientRequestStr)
>   println( "parsed : " + theParseResponseStr );
> //theREPL.readEvalPrint(theClientRequestStr)
> }
> catch {
>   case e => {
> val sw : java.io.StringWriter =new java.io.StringWriter( );
> e.printStackTrace( new java.io.PrintWriter( sw, true ) );
> theParseResponseStr = theParseResponseStr + e.toString
>   }
> }
> {theParseResponseStr}
>   }
>
>   def updateWhat(str: String): JsCmd = {
> println("updateWhat with " + str)
> JsCmds.SetHtml("parseTree", whatNode(str))
>   }
>
>   def show(xhtml: NodeSeq):