net.liftweb.util.BindHelpers
BindParam that binds a given value into a new attribute. For example, given the following markup:
<lift:AttrBinds > <div test:w="foo" /> <div test:x="foo" /> <div test:y="foo" /> <div test:z="foo" /> </lift:AttrBinds >
The following snippet:
import scala.xml._ class AttrBinds { def render(xhtml : NodeSeq) : NodeSeq = BindHelpers.bind("test", xhtml, AttrBindParam("w", Text("fooW"), "id"), AttrBindParam("x", "fooX", "id"), AttrBindParam("y", Text("fooW"), ("lift","calcId")), AttrBindParam("z", "fooZ", ("lift", "calcId")))
produces this markup:
<div id="fooW" /> <div id="fooX" /> <div lift:calcId="fooY" /> <div lift:calcId="fooZ" />
the name of the binding to replace
the value of the new attribute
The new attribute label
BindParam that binds a given value into a new attribute. For example, given the following markup:
The following snippet:
import scala.xml._ class AttrBinds { def render(xhtml : NodeSeq) : NodeSeq = BindHelpers.bind("test", xhtml, AttrBindParam("w", Text("fooW"), "id"), AttrBindParam("x", "fooX", "id"), AttrBindParam("y", Text("fooW"), ("lift","calcId")), AttrBindParam("z", "fooZ", ("lift", "calcId")))produces this markup: