值不存在于可选块的下拉列表中 - jelly/jenkins
values not persisting in dropdown of optional block - jelly/jenkins
我在 config.jelly 中有以下内容:
<f:block>
<table style="width:100%" id="rpmParameters-generic">
<j:set var="rpmParameters" value="${instance.rpmParameters}" />
<f:optionalBlock name="rpmParameters" checked="${rpmParameters != null}"
title="Mandatory parameter for rpm/msi/zip artifacts only" help="/plugin/artifactory/help/common/help-rpmParameters.html">
<input type="hidden" name="stapler-class" value="org.jfrog.hudson.util.RpmParameters" />
<f:entry title="Operating System">
<select class="setting-input" name="operatingSystem"
value="${rpmParameters.operatingSystem}">
<option value="rhel5">rhel5</option>
<option value="linux">linux</option>
<option value="solaris">solaris</option>
<option value="windows">windows</option>
</select>
</f:entry>
<f:entry title="Architecture">
<select class="setting-input" name="architecture"
value="${rpmParameters.architecture}">
<option value="i386">i386</option>
<option value="x86_64">x86_64</option>
<option value="no arch">no arch</option>
</select>
</f:entry>
</f:optionalBlock>
</table>
</f:block>
问题是,当我点击保存时,可选块的复选框仍然存在,但由于某种原因,在我保存并重新打开配置后,操作系统和体系结构的下拉值在 UI 中不存在。
知道为什么吗?
事实证明我做的大部分事情都是对的。问题是
<f:options
对于下拉列表中的每个选项。这样的事情奏效了。
<select class="setting-input" name="artifactKey" id="genericArtifactKeys-${s.url}">
<f:option value="nuget" selected="${instance.artifactoryKey =='nuget'}">nuget</f:option>
<f:option value="zip" selected="${instance.artifactoryKey =='zip'}">zip</f:option>
<f:option value="msi" selected="${instance.artifactoryKey =='msi'}">msi</f:option>
<f:option value="rpm" selected="${instance.artifactoryKey =='rpm'}">rpm</f:option>
</select>
我在 config.jelly 中有以下内容:
<f:block>
<table style="width:100%" id="rpmParameters-generic">
<j:set var="rpmParameters" value="${instance.rpmParameters}" />
<f:optionalBlock name="rpmParameters" checked="${rpmParameters != null}"
title="Mandatory parameter for rpm/msi/zip artifacts only" help="/plugin/artifactory/help/common/help-rpmParameters.html">
<input type="hidden" name="stapler-class" value="org.jfrog.hudson.util.RpmParameters" />
<f:entry title="Operating System">
<select class="setting-input" name="operatingSystem"
value="${rpmParameters.operatingSystem}">
<option value="rhel5">rhel5</option>
<option value="linux">linux</option>
<option value="solaris">solaris</option>
<option value="windows">windows</option>
</select>
</f:entry>
<f:entry title="Architecture">
<select class="setting-input" name="architecture"
value="${rpmParameters.architecture}">
<option value="i386">i386</option>
<option value="x86_64">x86_64</option>
<option value="no arch">no arch</option>
</select>
</f:entry>
</f:optionalBlock>
</table>
</f:block>
问题是,当我点击保存时,可选块的复选框仍然存在,但由于某种原因,在我保存并重新打开配置后,操作系统和体系结构的下拉值在 UI 中不存在。
知道为什么吗?
事实证明我做的大部分事情都是对的。问题是
<f:options
对于下拉列表中的每个选项。这样的事情奏效了。
<select class="setting-input" name="artifactKey" id="genericArtifactKeys-${s.url}">
<f:option value="nuget" selected="${instance.artifactoryKey =='nuget'}">nuget</f:option>
<f:option value="zip" selected="${instance.artifactoryKey =='zip'}">zip</f:option>
<f:option value="msi" selected="${instance.artifactoryKey =='msi'}">msi</f:option>
<f:option value="rpm" selected="${instance.artifactoryKey =='rpm'}">rpm</f:option>
</select>