Re: Build problem. Was: Re: [Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-08 Thread David Pollak
Marc, Sorry... dunno what to tell you. :-( David On Thu, Jan 8, 2009 at 3:47 PM, Marc Boschma > wrote: > Very cool indeed, except... I now get: > [WARNING] > /Users/marc/src/todo/src/main/scala/com/liftworkshop/snippet/TD.scala:99: > error: value attr is not a member of object net.liftweb.util.

Build problem. Was: Re: [Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-08 Thread Marc Boschma
Very cool indeed, except... I now get: [WARNING] /Users/marc/src/todo/src/main/scala/com/liftworkshop/snippet/ TD.scala:99: error: value attr is not a member of object net.liftweb.util.BindHelpers [WARNING] val singular = BindHelpers.attr("singular", {s: String => s.toLowerCase

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-08 Thread David Pollak
On Thu, Jan 8, 2009 at 9:54 AM, Marius wrote: > > Ok, I just committed the updates. Now both BindHelpers.attr and S.attr > implement AttrHelpers trait where we have a bunch of overloaded apply, > > I would have liked to use Option[NodeSeq] for S.attr as well but this > would be a breaking change

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-08 Thread Marius
On Jan 8, 7:54 pm, Marius wrote: > Ok, I just committed the updates. Now both BindHelpers.attr and S.attr > implement AttrHelpers trait where we have a bunch of overloaded apply, > > I would have liked to use Option[NodeSeq] for S.attr as well but this > would be a breaking change and breaking c

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-08 Thread Marius
Ok, I just committed the updates. Now both BindHelpers.attr and S.attr implement AttrHelpers trait where we have a bunch of overloaded apply, I would have liked to use Option[NodeSeq] for S.attr as well but this would be a breaking change and breaking changes are frozen now. So S.attr("someparam"

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-07 Thread David Pollak
Marc, Good suggestion. Marius -- do you want to do this... maybe even turn the pattern into a trait that we can apply over and over? Thanks, David On Tue, Jan 6, 2009 at 9:57 PM, Marc Boschma > wrote: > Cool code! Works nicely... > Would it make sense to also add something similar to this fr

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-07 Thread Marius
I'll look into it. On Jan 7, 7:38 pm, "David Pollak" wrote: > Marc, > > Good suggestion.  Marius -- do you want to do this... maybe even turn the > pattern into a trait that we can apply over and over? > > Thanks, > > David > > On Tue, Jan 6, 2009 at 9:57 PM, Marc Boschma > > > > wrote: > > Coo

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread Marc Boschma
Cool code! Works nicely... Would it make sense to also add something similar to this from S.attr ? def apply[T](what: String, f: String => T, default: => T): T = apply(what).map(f) openOr default ie maybe: def apply[T](prefix: String, key: String, f: String => T): Option[T] = apply(pr

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread David Pollak
On Tue, Jan 6, 2009 at 11:16 AM, Marius wrote: > > Ok ... i just committed some changes: > > 1. Renamed curAttr to attr > 2. The BindHelpers vals are now private but we expose two functions > currentNode and bindNodes Cool beans! > > > Br's, > Marius > > On Jan 6, 8:37 pm, "David Pollak" > w

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread Marius
Ok ... i just committed some changes: 1. Renamed curAttr to attr 2. The BindHelpers vals are now private but we expose two functions currentNode and bindNodes Br's, Marius On Jan 6, 8:37 pm, "David Pollak" wrote: > On Tue, Jan 6, 2009 at 10:28 AM, Marius wrote: > > > On Jan 6, 7:15 pm, "David

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread David Pollak
On Tue, Jan 6, 2009 at 10:28 AM, Marius wrote: > > > > On Jan 6, 7:15 pm, "David Pollak" > wrote: > > I also added > > BindHelpers.attr("tag"): Option[NodeSeq] > > so you can do something like: > > > > ... > > > > and: > > BindHelpers.attr("prefix", "tag") > > I think it is committed to curAttr

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread Marius
On Jan 6, 7:15 pm, "David Pollak" wrote: > I also added > BindHelpers.attr("tag"): Option[NodeSeq] > so you can do something like: > > ... > > and: > BindHelpers.attr("prefix", "tag") I think it is committed to curAttr which personally I'm not a fan ... Doyou mind if I change it to attr or nod

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread David Pollak
I also added BindHelpers.attr("tag"): Option[NodeSeq] so you can do something like: ... and: BindHelpers.attr("prefix", "tag") Thanks, David On Tue, Jan 6, 2009 at 9:13 AM, Marius wrote: > > Very cool Dave ! > > thx, > Marius > > On Jan 6, 4:36 pm, "David Pollak" > wrote: > > Folks, > > > >

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread Marius
Very cool Dave ! thx, Marius On Jan 6, 4:36 pm, "David Pollak" wrote: > Folks, > > I'm about to commit up a non-breaking solution. > > In bind, you can call: > BindHelpers.bindNodes.value: List[NodeSeq] > BindHelpers.currentNode.value: Elem > > bindNodes is a list of the nodes that were passed

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread David Pollak
Folks, I'm about to commit up a non-breaking solution. In bind, you can call: BindHelpers.bindNodes.value: List[NodeSeq] BindHelpers.currentNode.value: Elem bindNodes is a list of the nodes that were passed into bind with the more current node at the head of the list. If you're doing hierarchic

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread Marius
On Jan 6, 2:50 pm, Marc Boschma wrote: > I've just had a thought as to how to make it not a breaking change. > > Leave your change "calcValue(s.child) I just call calcValue(s)" > > change: >    case class FuncBindParam(name: String, value: NodeSeq => NodeSeq)   > extends Tuple2(name, value) wit

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread Marc Boschma
I've just had a thought as to how to make it not a breaking change. Leave your change "calcValue(s.child) I just call calcValue(s)" change: case class FuncBindParam(name: String, value: NodeSeq => NodeSeq) extends Tuple2(name, value) with BindParam { def calcValue(in: NodeSeq): NodeSeq

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread Marc Boschma
(you can tel I'm sleeping well :/ - too hot) The toList function is one of David's (todo example app). I do love the ability to curry :) Marc On 06/01/2009, at 9:51 PM, Marius wrote: > > > > On Jan 6, 12:47 pm, Marc Boschma wrote: >> A quick just before going to bed reaction is that your cha

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread Marius
On Jan 6, 12:47 pm, Marc Boschma wrote: > A quick just before going to bed reaction is that your change would   > solve the issue. Yeah it would ... (I mean it worked fine in my tests) > > It is interesting you focused on the "exclude" and not the   > "list" (which is what I have been playing

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread Marc Boschma
A quick just before going to bed reaction is that your change would solve the issue. It is interesting you focused on the "exclude" and not the "list" (which is what I have been playing with). I actually missed it was a similar case... Regards, Marc On 06/01/2009, at 9:24 PM, Marius wrot

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread Marius
I just did a minor modification to the lift code so the actual node it is passed to the BindParam and not its child. Now having: bind("todo", html, "exclude" -> {node:NodeSeq =>ajaxCheckbox (QueryNotDone, v => {QueryNotDone(v); reDraw})} ... ) and the markup The node p

[Lift] Re: accessing the attributes of the XML node associated with a FuncBindParam in bind(...)

2009-01-06 Thread Marius
A nice alternative would have been : bind("todo", html, "exclude" -> {node:NodeSeq =>ajaxCheckbox (QueryNotDone, v => {QueryNotDone(v); reDraw})} ... ) But here the node impersonates the childNodes not the original node. So you still can not access the param attribute b