Kris, Jorge changed bind to accept the -> stuff... please provide stand-along examples of --> working and -> failing so he can do what he needs to do to fix up the code.
Thanks, David On Wed, Sep 17, 2008 at 2:53 PM, Kris Nuttycombe <[EMAIL PROTECTED]>wrote: > > Hi, all, > > I noticed this in the BindHelpers code: > > # /** > # * This class creates a BindParam from an input value > # * > # * @deprecated use -> instead > # */ > # @deprecated > # class BindParamAssoc(val name: String) { > # def -->(value: String): BindParam = TheBindParam(name, Text(value)) > # def -->(value: NodeSeq): BindParam = TheBindParam(name, value) > # def -->(value: Symbol): BindParam = TheBindParam(name, Text( > value.name)) > # def -->(value: Any): BindParam = TheBindParam(name, Text(if > (value == null) "null" else value.toString)) > # def -->(func: NodeSeq => NodeSeq): BindParam = FuncBindParam(name, > func) > # def -->(value: Can[NodeSeq]): BindParam = TheBindParam(name, > value.openOr(Text("Empty"))) > # } > > and so dutifully modified my code to use ->, but I'm having trouble > finding a version of bind() that this works with. I assumed that it > would be in BindHelpers, but didn't find a bind() that was appropriate > (at least, Helpers.bind(...) didn't work when called.) > > I'm using the usual signature of bind(prefix, xhtml, "foo" -> ..., > "bar" -> ...). > > This brings up a related question; I decided to create some implicit > defs that would wrap my model objects appropriately such that I could > just call myModelObject.bind(xhtml) within whatever snippet I am > concerned with. The base class of my standard wrapper looks like this: > > abstract class EntityBinder[+A](val a : A) { > def bind(xhtml : NodeSeq) : NodeSeq > } > > and an implementation might look like: > > import net.liftweb.util.Helpers._ > import scala.xml._ > > class FooBinder(foo : Foo) extends EntityBinder[Foo](foo) { > def bind(xhtml : NodeSeq) : NodeSeq = { > bind("foo", xhtml, "baz" -> NodeSeq.Empty) > } > } > > My class hierarchy has three or four levels, each of which binds some > set of tags to the results of a call to super.bind(xhtml). > > For some reason, the Scala compiler can't figure out that the bind() I > want to call in the implementation is Helpers.bind - it gives me this: > > [WARNING] > /home/knuttycombe/work/gcsi/gcsi-admin/src/main/scala/com/gaiam/gcsi/view/EntityBinder.scala:114: > error: wrong number of arguments for method bind: > (scala.xml.NodeSeq)scala.xml.NodeSeq > [WARNING] bind("t", super.bind(xhtml), > [WARNING] ^ > > Any idea why it's not using the imported bind function? > > If I'm barking completely up the wrong tree with my approach here, > that information would also be useful! Thanks, > > Kris > > > > -- Lift, the simply functional web framework http://liftweb.net Collaborative Task Management http://much4.us Follow me: http://twitter.com/dpp Git some: http://github.com/dpp --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---