Grails: Invoking one taglib from within another

Viewed 6407

I want to define my own taglib that will use the g:datePicker to generate some of it's output.

class MyTagLib

  def myTag = {attrs ->
    // I need to invoke the `datePicker` tag of the the `FormTagLib` tag library
    // provided by Grails       
  }
}

I want to pass along the attributes map when I invoke this tag. When I invoke g:datePicker I would like it to write it's output directly to the response (just as it does when you invoke it within a GSP).

How can I do this? Thanks.

2 Answers

out << g.datePicker(etc...) ought to do it. The other taglib prefixes are metaprogrammed in automatically.

Related