[Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread Marius
This same thing is also touched by http://reviewboard.liftweb.net/r/184/ (driven by Kris' post) Do you agree with these following statements: 1. The SHtml Ajax function should return JsCmd 2. The SHtml non Ajax function should return a Unit instead of Any (unless there are compelling reasons to

Re: [Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread David Pollak
On Fri, Jan 22, 2010 at 2:22 AM, Marius marius.dan...@gmail.com wrote: This same thing is also touched by http://reviewboard.liftweb.net/r/184/ (driven by Kris' post) Do you agree with these following statements: 1. The SHtml Ajax function should return JsCmd Yes. 2. The SHtml non Ajax

Re: [Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread Naftoli Gugenheim
I'm curious to know the difference between returning Any or Unit, if you remember. Is it possible it was a bug in Scala? - David Pollakfeeder.of.the.be...@gmail.com wrote: On Fri, Jan 22, 2010 at 2:22 AM, Marius marius.dan...@gmail.com wrote: This same

Re: [Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread David Pollak
On Fri, Jan 22, 2010 at 10:36 AM, Naftoli Gugenheim naftoli...@gmail.comwrote: I'm curious to know the difference between returning Any or Unit, if you remember. Is it possible it was a bug in Scala? Returning Any returns the value of the last expression in the function. Returning Unit always

[Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread Marius
Very well then. If you do recall the rationale for keeping Any for non Ajax function, please let me/us know about it or add a comment in the code as I get the feeling that this will raise up again in the future. Br's, Marius On Jan 22, 8:36 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: I'm

Re: [Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread Naftoli Gugenheim
Sorry for not being more precise. If I understood you, you said there are times where a function whose return value is *not* used, but still code broke when the expected type was changed to the more correct Unit. Is that not what you were referring to when you said you don't remember why but it

Re: [Lift] Re: Simple Ajax call to server side function

2010-01-22 Thread David Pollak
On Fri, Jan 22, 2010 at 12:57 PM, Naftoli Gugenheim naftoli...@gmail.comwrote: Sorry for not being more precise. If I understood you, you said there are times where a function whose return value is *not* used, You misunderstood me. but still code broke when the expected type was changed

Re: [Lift] Re: Simple Ajax call to server side function

2010-01-21 Thread David Pollak
On Mon, Jan 18, 2010 at 10:31 AM, Felipe Rodrigues felipero.maill...@gmail.com wrote: That's a little better.. thanks Originally, the function returned Any... and this led to problems (people returning HTML, Strings, etc.) It turns out that 95% of the time, you want to do something to tell

[Lift] Re: Simple Ajax call to server side function

2010-01-18 Thread greekscala
Hello, know what you mean. You can use JsCmds._Noop to return nohting as JsCmd. best regards On 18 Jan., 17:25, Felipe Rodrigues felipero.maill...@gmail.com wrote: Here is how I made it, but seems ugly: SHtml.a(() = {serverSideFunction(t.text); Call(void, Num(0)).cmd}, t) It is awkward

Re: [Lift] Re: Simple Ajax call to server side function

2010-01-18 Thread Felipe Rodrigues
That's a little better.. thanks greekscala wrote: Hello, know what you mean. You can use JsCmds._Noop to return nohting as JsCmd. best regards On 18 Jan., 17:25, Felipe Rodrigues felipero.maill...@gmail.com wrote: Here is how I made it, but seems ugly: SHtml.a(() =