BindParam that binds a given value into a new attribute.
Base class for Bind parameters.
A trait that indicates what the newly bound attribute name should be.
BindParam that computes a new attribute value based on the current attribute value.
BindParam that computes an optional new attribute value based on the current attribute value.
BindParam that computes an optional new attribute value based on the current attribute value.
BindParam using a function to calculate its value
A case class that wraps attribute-oriented BindParams to allow prefixing the resulting attribute
Constant BindParam always returning the same value
Constant BindParam always returning the same value
This class creates a BindParam from an input value
BindParam that binds a given value into a new attribute.
BindParam using a function to calculate its value.
BindParam that computes an optional new attribute value based on the current attribute value.
BindParam that computes an optional new attribute value based on the current attribute value.
takes a NodeSeq and applies all the attributes to all the Elems at the top level of the NodeSeq.
takes a NodeSeq and applies all the attributes to all the Elems at the top level of the NodeSeq. The id attribute is applied to the first-found Elem only
Adds a css class to the existing class tag of an Elem or create the class attribute
Adds a css class to the existing class tag of an Elem or create the class attribute
Adds a css class to the existing class tag of an Elem or create the class attribute
Adds a css class to the existing class tag of an Elem or create the class attribute
Helpers for obtaining attributes of the current Elem
Replace the content of lift:bind nodes with the corresponding nodes found in a map, according to the value of the "name" attribute.
Replace the content of lift:bind nodes with the corresponding nodes found in a map, according to the value of the "name" attribute.
Usage:
bind(Map("a" ->
= ), change this ) must ==/(
= =
)
map of name/nodes to replace
nodes containing lift:bind nodes
the NodeSeq that results from the specified transforms
Bind a set of values to parameters and attributes in a block of XML with defined transforms for unbound elements within the specified namespace.
Bind a set of values to parameters and attributes in a block of XML with defined transforms for unbound elements within the specified namespace.
For example:
bind("user",
Full(xhtml: NodeSeq => Text("Default Value")),
Empty,
replace this replace with default ,
"hello" ->
= )
will return
= = Default Value
the namespace of tags to bind
a box containing the function to use as the default transform for tags in the specified namespace that do not have bindings specified.
a box containing the function to use as the default transform for unrecognized attributes in bound elements.
the NodeSeq in which to find elements to be bound.
the list of BindParam bindings to be applied
the NodeSeq that results from the specified transforms
Bind a set of values to parameters and attributes in a block of XML with defined transforms for unbound elements within the specified namespace.
Bind a set of values to parameters and attributes in a block of XML with defined transforms for unbound elements within the specified namespace.
For example:
bind("user",
Full(xhtml: NodeSeq => Text("Default Value")),
Empty,
replace this replace with default ,
"hello" ->
= )
will return
= = Default Value
the namespace of tags to bind
a box containing the function to use as the default transform for tags in the specified namespace that do not have bindings specified.
a box containing the function to use as the default transform for unrecognized attributes in bound elements.
the NodeSeq in which to find elements to be bound.
the list of BindParam bindings to be applied
the NodeSeq that results from the specified transforms
Bind a set of values to parameters and attributes in a block of XML.
Bind a set of values to parameters and attributes in a block of XML.
For example:
bind("user", replace this , "hello" ->
= )
will return
= =
the namespace of tags to bind
the NodeSeq in which to find elements to be bound.
the list of BindParam bindings to be applied
the NodeSeq that results from the specified transforms
A list of NodeSeq that preceeds the NodeSeq passed to bind.
A list of NodeSeq that preceeds the NodeSeq passed to bind. The head of the list is the most recent NodeSeq. This returns Empty if it is called outside its context, or Full(Nil) if there are no child nodes but the function is called within the appropriate context.
Bind a list of name/xml maps to a block of XML containing lift:bind nodes (see the bind(Map, NodeSeq) function)
Bind a list of name/xml maps to a block of XML containing lift:bind nodes (see the bind(Map, NodeSeq) function)
the NodeSeq that results from the specified transforms
Finds and returns one of many templates from the children based
upon the namespace and tag name: for example, for prefix "choose"
and tag name "stuff" this would return the contents of the
first tag <choose:stuff> ... </choose:stuff>
in the specified NodeSeq.
Finds and returns one of many templates from the children based
upon the namespace and tag name: for example, for prefix "choose"
and tag name "stuff" this would return the contents of the
first tag <choose:stuff> ... </choose:stuff>
in the specified NodeSeq.
the prefix (e.g., "choose")
the tag to choose (e.g., "stuff")
the node sequence to search for the specified element
the first matching node sequence
promote a String to a ToCssBindPromotor
promote a String to a ToCssBindPromotor
A Box containing the current Elem, the children of which are passed to the bindParam
For a list of NodeSeq, ensure that the the id of the root Elems are unique.
For a list of NodeSeq, ensure that the the id of the root Elems are unique. If there's a duplicate, that Elem will be returned without an id
Ensure that the first Element has the specified ID
Ensure that the first Element has the specified ID
For a list of NodeSeq, ensure that the the id of the root Elems are unique.
For a list of NodeSeq, ensure that the the id of the root Elems are unique. If there's a duplicate, that Elem will be returned without an id
Given a NodeSeq and a function that returns a Box[T], return the first value found in which the function evaluates to Full
Given a NodeSeq and a function that returns a Box[T], return the first value found in which the function evaluates to Full
Finds the first Element in the NodeSeq (or any children) that has an ID attribute
Finds the first Element in the NodeSeq (or any children) that has an ID attribute
Given an id value, find the Elem with the specified id
Given an id value, find the Elem with the specified id
Finds and returns the first node in the specified NodeSeq and its children with the same label and prefix as the specified element.
Finds and returns the first node in the specified NodeSeq and its children with the same label and prefix as the specified element.
Given a NodeSeq and a function that returns an Option[T], return the first value found in which the function evaluates to Some
Given a NodeSeq and a function that returns an Option[T], return the first value found in which the function evaluates to Some
Find the first Elem in the NodeSeq.
Find the first Elem in the NodeSeq. If it has an id attribute, then call the function, f, with that id. If the first Elem does not have an id attribute, create an id attribute and pass that id attribute to the function
Takes attributes from the first node of 'in' (if any) and mixes them into 'out'.
Takes attributes from the first node of 'in' (if any) and mixes them into 'out'. Curried form can be used to produce a NodeSeq => NodeSeq for bind.
where to put the attributes
where to take the attributes from
'out' element with attributes from 'in'
Replace the element with the id that matches with the replacement nodeseq.
Replace the element with the id that matches with the replacement nodeseq.
promote a String to a ToCssBindPromotor
promote a String to a ToCssBindPromotor
Remove all the <head> tags, just leaving the child tags
Remove all the <head> tags, just leaving the child tags
Find three of many templates from the children
Find three of many templates from the children
Find two of many templates from the children
Find two of many templates from the children
Similar to chooseTemplate, this returns the contents of the element in a Full Box if found or an Empty Box otherwise.
Similar to chooseTemplate, this returns the contents of the element in a Full Box if found or an Empty Box otherwise.
Finds the named attribute in specified XML element and returns a Full Box containing the value of the attribute if found.
Finds the named attribute in specified XML element and returns a Full Box containing the value of the attribute if found. Empty otherwise.
a Full Box containing the value of the attribute if found; Empty otherwise
transforms a Box into a Text node
Bind parameters to XML.
Bind parameters to XML.
XML with lift:bind elements
data to bind
(Since version 2.3) use the bind function instead
transforms a String to a BindParamAssoc object which can be associated to a BindParam object using the --> operator.
transforms a String to a BindParamAssoc object which can be associated to a BindParam object using the --> operator.
Usage: "David" --> "name"
(Since version 2.4) use -> instead
transforms a Symbol to a SuperArrowAssoc object which can be associated to a BindParam object using the -> operator.
transforms a Symbol to a SuperArrowAssoc object which can be associated to a BindParam object using the -> operator.
Usage: 'David -> "name"
(Since version 2.4) use -> instead
Experimental extension to bind which passes in an additional "parameter" from the XHTML to the transform function, which can be used to format the returned NodeSeq.
Experimental extension to bind which passes in an additional "parameter" from the XHTML to the transform function, which can be used to format the returned NodeSeq.
(Since version 2.4) use bind instead
BindHelpers can be used to obtain additional information while a
bindcall is executing. This informaiton includes node attributes of the current bound node or the entire NodeSeq that is to be bound. Since the context is created during bind execution and destroyed when bind terminates, you can benefit of these helpers in the context of FuncBindParam or FuncAttrBindParam. You can also provide your own implementation of BindParam and your BindParam#calcValue function will be called in the appropriate context.Example:
bind("hello", xml, "someNode" -> {node: NodeSeq =>})
In
function-bodyyou can safely use BindHelpers methods to obtain correctly-scoped information.