简体   繁体   English

MarkupBuilder呈现HTML SELECT元素

[英]MarkupBuilder Rendering HTML SELECT Element

I have the following in a TagLib 我在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. 当使用此taglib呈现页面时,我没有显示SELECT元素。 Other elements like INPUT work just fine using the same type of markup. 使用相同类型的标记,其他元素(例如INPUT)也可以正常工作。 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. 它只是没有最终标记。

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")
}
...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM