Having two nested tags, How is it possible to inject a variable into inner tag binding?
class CriteriaTagLib {
def criteria = { attrs, body ->
out << "start"
out << body.call()
out << "end"
}
def eq = {
out << "eq${group}"
}
}
And having in a GSP page :
<g:criteria>
<g:eq></g:eq>
<g:criteria>
The question is how to set a value for group (used inside of eq) from inside of criteria.
<q:criteria>can put own context/data as a request scope attribute (or page scope), and use it inside by<q:eq>(don’t forget to remove it on closing tag). Like: