[Lift] Re: Box and bind

2009-09-08 Thread Naftoli Gugenheim
Yup - José María wrote: OMG So, as -> begins with "-" then it has the precedence of the operator - On Sep 8, 7:52 pm, Naftoli Gugenheim wrote: > Precedence is determined by the first character of an operator. > > -

[Lift] Re: Box and bind

2009-09-08 Thread José María
OMG So, as -> begins with "-" then it has the precedence of the operator - On Sep 8, 7:52 pm, Naftoli Gugenheim wrote: > Precedence is determined by the first character of an operator. > > - > > Ross Mellgren wrote: > > Because the compiler interpret yo

[Lift] Re: Box and bind

2009-09-08 Thread Naftoli Gugenheim
Precedence is determined by the first character of an operator. - Ross Mellgren wrote: Because the compiler interpret your expression as you expect. Instead of: "url_enlace" -> ("/product/" + product.id.toString) which is what you wanted, it got: ("url_e

[Lift] Re: Box and bind

2009-09-08 Thread Naftoli Gugenheim
Operators starting with - and + have the same precendence so they are combined left to right. Thus you are concatenating a BindParam with a String, returning a String. - José María wrote: It worked when I put the () around the bind param and the questi

[Lift] Re: Box and bind

2009-09-08 Thread Ross Mellgren
Because the compiler interpret your expression as you expect. Instead of: "url_enlace" -> ("/product/" + product.id.toString) which is what you wanted, it got: ("url_enlace" -> "/product/") + product.id.toString) which it can do because it can take an arbitrary object: ("url_enlace" -> "/pr

[Lift] Re: Box and bind

2009-09-08 Thread José María
It worked when I put the () around the bind param and the question is ... why? On Sep 8, 7:35 pm, Ross Mellgren wrote: > So that doesn't seem to be a box-related thing so much as a bind   > argument related thing, probably because you have a precedence   > problem... try: > > producto.ma

[Lift] Re: Box and bind

2009-09-08 Thread José María
I adapted the code but not the error, Producto is Product in Spanish. On Sep 8, 7:35 pm, Ross Mellgren wrote: > So that doesn't seem to be a box-related thing so much as a bind   > argument related thing, probably because you have a precedence   > problem... try: > > producto.map(product => >

[Lift] Re: Box and bind

2009-09-08 Thread Ross Mellgren
So that doesn't seem to be a box-related thing so much as a bind argument related thing, probably because you have a precedence problem... try: producto.map(product => bind("product", xhtml, "url_enlace" -> ("/product/" + product.id.toString), ) ).openOr(NodeSeq.Empty) Also

[Lift] Re: Box and bind

2009-09-08 Thread José María
That's my code: val product = Product.find(id) producto.map(product => bind("product", xhtml, "url_enlace" --> "/product/" + product.id.toString , ) ).openOr(NodeSeq.Empty) } and I get this error: [INFO] use java command with args in file

[Lift] Re: Box and bind

2009-09-08 Thread Ross Mellgren
Well it depends on precisely what you want. If you want your snippet to become empty if the product is not there, try: productBox.map(product => { bind("product", ns, ...) }).openOr(NodeSeq.Empty) If you want only certain bind positions empty, do the same thing inside the bind: bind("pro

[Lift] Re: Box and bind

2009-09-08 Thread Naftoli Gugenheim
There should be implicits that allow you to bind to a Box of a NodeSeq, so you can bind to prodBox.map(_.toForm). Otherwise bind to prodBox.map(_.toForm).openOr(NodeSeq.Empty) etc. - José María wrote: Hi. Boxes are giving me a hard time. Say you have a mo