MarkupBuilder Rendering HTML SELECT Element
-
26-10-2019 - |
Question
I have the following in a TagLib
select(name:"foo", value: "1") {
option(value: "1", "hoo")
option(value: "2", "goo")
}
When the page renders using this taglib, I'm not getting a SELECT element to show up. Other elements like INPUT work just fine using the same type of markup. I know it is getting to this code because I've set breakpoints and debugged. Everything seems fine. It just doesn't end up in the final markup.
Solution
I had to change it to the following:
def formContainer = new MarkupBuilder(out)
....
formContainer.select(name:"foo", value: "1") {
option(value: "1", "hoo")
option(value: "2", "goo")
}
...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow