[Lift] Re: Template help

2009-11-11 Thread David Pollak
On Wed, Nov 11, 2009 at 12:35 AM, aw anth...@whitford.com wrote: I need to create a snippet sequence that looks something like this: a href=next span class=namename/span span class=commentdescription/span span class=arrow/ /a The anchor needs to be generated using SHtml.link,

[Lift] Re: Template help

2009-11-11 Thread Naftoli Gugenheim
You might need to surround the kids = ... function with parenthesis. - David Pollakfeeder.of.the.be...@gmail.com wrote: On Wed, Nov 11, 2009 at 12:35 AM, aw anth...@whitford.com wrote: I need to create a snippet sequence that looks something like this: a

[Lift] Re: Template help

2009-11-11 Thread aw
OK, your suggestion definitely makes the snippet code more readable, but I fear I didn't make my point clear because the snippet code still is highly coupled with the view layout. Imagine that I want to change my view from this: a href=next span class=namename/span span

[Lift] Re: Template help

2009-11-11 Thread Ross Mellgren
You can do a recursive bind, but you must make it explicit: def mySnippet(xhtml: NodeSeq): NodeSeq = { def doBind(xhtml: NodeSeq): NodeSeq = bind(b, xhtml, link - { (kids: NodeSeq) = SHtml.link(next, () = clicked(b), doBind(kids)) }, name - the name,

[Lift] Re: Template help

2009-11-11 Thread Jim Barrows
On Wed, Nov 11, 2009 at 11:21 AM, aw anth...@whitford.com wrote: OK, your suggestion definitely makes the snippet code more readable, but I fear I didn't make my point clear because the snippet code still is highly coupled with the view layout. If this was a MVC type framework, I think

[Lift] Re: Template help

2009-11-11 Thread Naftoli Gugenheim
I didn't see Tim's blog post, but another option is to bind in two passes. First bind the outer level: b1:link should become an SHtml.link, preserving the same set of child elements. So here use a NodeSeq function: kids = SHtml.link(..., kids). Then pass the resulting NodeSeq to a bind