[Lift] Re: JsonResponse with non string values

2009-11-09 Thread GA
Thanks for the answer. This line does the trick: newUser.id.asJsExp . It returns a type net.liftweb.http.js.JE.numToJsExp. GA On Nov 9, 2009, at 6:31 PM, Ross Mellgren wrote: > > Bring the numToJsExp implicit into scope -- import > net.liftweb.http.js.JE.numToJsExp > > -Ross > > On Nov 9, 2

[Lift] Re: JsonResponse with non string values

2009-11-09 Thread Ross Mellgren
Bring the numToJsExp implicit into scope -- import net.liftweb.http.js.JE.numToJsExp -Ross On Nov 9, 2009, at 12:22 PM, GA wrote: > > Hello guys, > > I have the following code working ok: > > JsonResponse(JsObj("Op" -> 0,"e" -> 0,"id" -> > newUser.id.toString)) > > The

[Lift] Re: JsonResponse and Constructing a JsArray

2009-10-02 Thread Peter Robinett
Thanks, that did the trick. Peter On Oct 2, 11:15 am, Jeppe Nejsum Madsen wrote: > Peter Robinett writes: > > Hi all, I'm getting the following error and I think I'm missing > > something very simple: > > error: type mismatch; > >  found   : List[net.liftweb.http.js.JsExp] > >  required: net.l

[Lift] Re: JsonResponse and Constructing a JsArray

2009-10-02 Thread Jeppe Nejsum Madsen
Peter Robinett writes: > Hi all, I'm getting the following error and I think I'm missing > something very simple: > error: type mismatch; > found : List[net.liftweb.http.js.JsExp] > required: net.liftweb.http.js.JsExp > JsonResponse(JsObj("results" -> JsArray(packets.map(_.asJs > >

[Lift] Re: JsonResponse

2009-07-13 Thread Peter Robinett
Thanks, David. --~--~-~--~~~---~--~~ 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...@googlegroup

[Lift] Re: JsonResponse

2009-07-13 Thread David Pollak
On Mon, Jul 13, 2009 at 1:32 PM, Peter Robinett wrote: > > Thanks guys, I happened to be looking for this right now. > > For those looking to output single Boxed result from findAll, I think > you would do something like this: > JsonResponse(JsObj("results" -> Node.find(By(Content.id, > yourIdQuer

[Lift] Re: JsonResponse

2009-07-13 Thread Peter Robinett
Thanks guys, I happened to be looking for this right now. For those looking to output single Boxed result from findAll, I think you would do something like this: JsonResponse(JsObj("results" -> Node.find(By(Content.id, yourIdQuery)).openOr(Content).asJs)) The problem is that if the Content row i

[Lift] Re: JsonResponse

2009-07-13 Thread David Pollak
On Mon, Jul 13, 2009 at 11:42 AM, fbettag wrote: > > JsonResponse(JsObj("results" -> JsArray(Content.findAll.map{ o => > o.asJs } :_* ))) > > this works. > Great! > > On Jul 13, 8:08 pm, fbettag wrote: > > WebServices.scala:118: error: type mismatch; > > found : net.liftweb.http.js.JsExp >

[Lift] Re: JsonResponse

2009-07-13 Thread fbettag
JsonResponse(JsObj("results" -> JsArray(Content.findAll.map{ o => o.asJs } :_* ))) this works. On Jul 13, 8:08 pm, fbettag wrote: > WebServices.scala:118: error: type mismatch; >  found   : net.liftweb.http.js.JsExp >  required: Iterable[net.liftweb.http.js.JsExp] >                 JsObj("resul

[Lift] Re: JsonResponse

2009-07-13 Thread fbettag
WebServices.scala:118: error: type mismatch; found : net.liftweb.http.js.JsExp required: Iterable[net.liftweb.http.js.JsExp] JsObj("results" -> JsArray(Content.findAll.flatMap(_.asJs) :_* )) ^ one error found

[Lift] Re: JsonResponse

2009-07-13 Thread David Pollak
On Mon, Jul 13, 2009 at 10:11 AM, fbettag wrote: > > i've read almost every topic about JsonResponse and i've played with > it for the _whole_ day. I don't get it to work and it drives me more > than nuts by now. > > I just want a simple list dumped to json: > >def listContents(): JsonRes