[Lift] Re: Snippet question

2010-01-21 Thread Franz Bettag
One last question, is there any way to give an ajaxText some kind of style/class/id attribute? I looked at the source but it was really hard to get the hang of it. best regards. On 21 Jan., 02:05, Franz Bettag fr...@bett.ag wrote: Ah, i was already wondering if that was a typo or what it does

Re: [Lift] Re: Snippet question

2010-01-21 Thread Ross Mellgren
The signature of ajaxText is: def ajaxText(value : String, func : (String) = JsCmd, attrs : (String, String)*): Elem def ajaxText(value : String, jsFunc : Call, func : (String) = JsCmd, attrs : (String, String)*): Elem The attrs vararg is for this purpose, just pass in additional attributes

[Lift] Re: Snippet question

2010-01-21 Thread Franz Bettag
Hm, i saw a method with attrs, but it was private. guess i overlooked it. thanks. On 21 Jan., 22:46, Ross Mellgren dri...@gmail.com wrote: The signature of ajaxText is: def ajaxText(value : String, func : (String) = JsCmd, attrs : (String, String)*): Elem def ajaxText(value : String, jsFunc

[Lift] Re: Snippet question

2010-01-20 Thread Franz Bettag
Ah figured it out. Played long enough around to get the right way: () = {expand(trafficReply.subnet)} Another question though, would it be possible to use IPs:expandspantraffic:sometag//span/IPs:expand and pass the given NodeSeq over the bind into a function? On 20 Jan., 19:08, Franz Bettag

Re: [Lift] Re: Snippet question

2010-01-20 Thread Naftoli Gugenheim
You can pass a NodeSeq=NodeSeq function to bind instead of a plain NodeSeq. - Franz Bettagfr...@bett.ag wrote: Ah figured it out. Played long enough around to get the right way: () = {expand(trafficReply.subnet)} Another question though, would it be possible

Re: [Lift] Re: Snippet question

2010-01-20 Thread Naftoli Gugenheim
Meaning to the right of the - arrow. - Franz Bettagfr...@bett.ag wrote: Ah figured it out. Played long enough around to get the right way: () = {expand(trafficReply.subnet)} Another question though, would it be possible to use

[Lift] Re: Snippet question

2010-01-20 Thread Franz Bettag
How would that look like? foo = nodeSeqMethod _ ? On 20 Jan., 21:21, Naftoli Gugenheim naftoli...@gmail.com wrote: Meaning to the right of the - arrow. - Franz Bettagfr...@bett.ag wrote: Ah figured it out. Played long enough around to get the right way:

[Lift] Re: Snippet question

2010-01-20 Thread greekscala
Hello, yes a function that takes NodeSeq parameter and returns a NodeSeq :) foo - (ns) = {function body} or foo - theCalledFunction best regards On 20 Jan., 21:26, Franz Bettag fr...@bett.ag wrote: How would that look like? foo = nodeSeqMethod _ ? On 20 Jan., 21:21, Naftoli Gugenheim

[Lift] Re: Snippet question

2010-01-20 Thread Franz Bettag
expand - (fooXhtml) = { Log.error(fooXhtml.toString); span/ }, error: not a legal formal parameter (pointing at the = ) On 20 Jan., 21:32, greekscala hellectro...@gmail.com wrote: Hello, yes a function that takes NodeSeq parameter and returns a NodeSeq :) foo - (ns) = {function body} or

Re: [Lift] Re: Snippet question

2010-01-20 Thread Ross Mellgren
Scala can't figure out what type of parameter you mean, so you need to annotate it -- expand - (fooXhtml: NodeSeq) = {... } Or use a separately named function with a type signature, e.g. def doTheStuff(ns: NodeSeq): NodeSeq) = { Log.error(ns.toStrnig); span / } bind(..., expand - doTheStuff

Re: [Lift] Re: Snippet question

2010-01-20 Thread Ross Mellgren
Well, it would help to have the compiler error, but I may have gotten precedence wrong. Try: expand - { (fooXhtml: NodeSeq) = ... } instead -Ross On Jan 20, 2010, at 3:51 PM, Franz Bettag wrote: That doesn't seem to fix the compiler error. :) On 20 Jan., 21:44, Ross Mellgren

[Lift] Re: Snippet question

2010-01-20 Thread Franz Bettag
What i am trying to do, maybe i am doing it all wrong. The html/xml can be found here: http://pastie.org/787126 The question is, what is the best way to render the bound XML which i pass in ip:expand, so that upon the actions click, it will be rendered in the correct table on the page. I haven't

Re: [Lift] Re: Snippet question

2010-01-20 Thread Naftoli Gugenheim
Yes, the problem is the operator precedence. If the function consists of one expression you can use parenthesis instead of curly braces. If you're using curly braces, you don't need the parenthesis around the argument: { ns: NodeSeq = ... - Ross

Re: [Lift] Re: Snippet question

2010-01-20 Thread Naftoli Gugenheim
The problem with writing two spans in Scala is that one is a whole expression. So either concatenate them with ++, or surround them with xml:group..., which is a fake xml element to wrap a few elements as one expression. - Franz Bettagfr...@bett.ag wrote:

[Lift] Re: Snippet question

2010-01-20 Thread Franz Bettag
Of course i forgot to paste the snippet.. http://pastie.org/787160 On 20 Jan., 21:44, Ross Mellgren dri...@gmail.com wrote: Scala can't figure out what type of parameter you mean, so you need to annotate it  -- expand - (fooXhtml: NodeSeq) = {... } Or use a separately named function with a

[Lift] Re: Snippet question

2010-01-20 Thread Franz Bettag
Works like a charm now! Thanks! One last question tho, is it possible to get a client-Side-callback for net.liftweb.http.SHtml.a? I want to start showing a specific ajax spinner (have more than one on the page) upon pressing a special link. I don't get how i might chain them together. :) On 20

Re: [Lift] Re: Snippet question

2010-01-20 Thread Ross Mellgren
Use to combine JsCmd. e.g. JsShowId(ajax-spinner) SetHtml(subnet-1234, spanmy awesome subnet contents/span) -Ross On Jan 20, 2010, at 7:16 PM, Franz Bettag wrote: Works like a charm now! Thanks! One last question tho, is it possible to get a client-Side-callback for

[Lift] Re: Snippet question

2010-01-20 Thread Franz Bettag
Ah, i was already wondering if that was a typo or what it does =) thank you very much. The project is coming along nicely. You really notice the performance difference between our old one (ruby based) and scala. Lift delivery the list of all subnets in 2.6 seconds. Merb needed almost 8 seconds

[Lift] Re: Snippet question

2008-09-13 Thread Marius
Does the Misc class package corresponds with the snippet folder? ... looks like it could not lod the Misc class as a snippet. Br's, Marius On Sep 12, 8:37 am, Charles F. Munat [EMAIL PROTECTED] wrote: I copied the Misc snippet over from the example, changed the package and import statements

[Lift] Re: Snippet question

2008-09-13 Thread David Pollak
If your root package is com.foo and you've got a line in Boot: LiftRules.addToPackages(com.foo) then the Misc class has to live in com.foo.snippet to be found by Lift. On Thu, Sep 11, 2008 at 10:37 PM, Charles F. Munat [EMAIL PROTECTED] wrote: I copied the Misc snippet over from the example,