[英]Read html select value into jenkins Active Choices Reactive Parameter
I saw many examples for Active Choices Reactive Parameter using formatted html, but none of these use the HTML select input type.我看到许多使用格式化 html 的 Active Choices Reactive Parameter 示例,但没有一个使用 HTML select 输入类型。
Here is my html snippet (simplified input of json_files for brevity):这是我的 html 片段(为简洁起见,简化了 json_files 的输入):
def json_files = ["a", "b", "c"]
html_to_be_rendered = """<select id="config" name="config">"""
json_files.each { json_file ->
html_to_be_rendered = """
${html_to_be_rendered}
<option value="${json_file}">${json_file}</option>
"""
}
return "${html_to_be_rendered}</select>"
I thought I should be able to read the selected value using ${config}, but seems that doesn't work.我认为我应该能够使用 ${config} 读取选定的值,但似乎不起作用。
This is how I define it in the jenkins GUI:这是我在 jenkins GUI 中定义它的方式:
What am I missing?我错过了什么?
The only problem you have is the name
attribute of the select
should be hard-coded to value
.您遇到的唯一问题是select
的name
属性应该硬编码为value
。 no need for the id
attribute.不需要id
属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.