Navigation Menu

Skip to content

Commit

Permalink
[FIXED JENKINS-28046][JENKINS-25403] Now uses f:dropdownDescriptorSel…
Browse files Browse the repository at this point in the history
…ector, which is provided by Jenkins core. This avoids problem with Jenkins-1.610. / Now handles also $class not only stapler-class.
  • Loading branch information
ikedam committed Apr 26, 2015
1 parent f7e23a3 commit 4273077
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
Expand Up @@ -188,12 +188,13 @@ private <T extends Describable<?>> T bindJSONWithDescriptor(
if (formData == null || formData.isNullObject()) {
return null;
}
if (!formData.has("stapler-class")) {
throw new FormException("No stapler-class is specified", fieldName);
String staplerClazzName = formData.optString("$class", null);
if (staplerClazzName == null) {
// Fall back on the legacy stapler-class attribute.
staplerClazzName = formData.optString("stapler-class", null);
}
String staplerClazzName = formData.getString("stapler-class");
if (staplerClazzName == null) {
throw new FormException("No stapler-class is specified", fieldName);
throw new FormException("No $stapler nor stapler-class is specified", fieldName);
}
try {
@SuppressWarnings("unchecked")
Expand Down
Expand Up @@ -31,34 +31,7 @@ THE SOFTWARE.
<f:entry title="${%Description}" field="description" help="/help/parameter/description.html">
<f:textarea />
</f:entry>
<f:dropdownList title="${%Choice Provider}" name="choiceListProvider" help="${descriptor.getHelpFile('choiceListProvider')}">
<j:forEach
var="curDescriptor"
items="${descriptor.enabledChoiceListProviderList.iterator()}"
varStatus="loop">
<j:scope>
<j:set
var="choiceListProvider"
value="${curDescriptor==instance.choiceListProvider.descriptor?instance.choiceListProvider:null}"
/>
<f:dropdownListBlock
title="${curDescriptor.displayName}"
value="${loop.index}"
selected="${choiceListProvider != null}"
staplerClass="${curDescriptor.clazz.name}"
><j:scope>
<!-- Shown only when corresponding ChoiceProvider is selected. -->
<j:set var="descriptor" value="${curDescriptor}" />
<j:set var="instance" value="${choiceListProvider}" />
<!--
Call config.jelly of the ChoiceProvider subclass.
Do nothing if config.jelly is not provided.
-->
<st:include page="config.jelly" class="${curDescriptor.clazz}" optional="${true}" />
</j:scope></f:dropdownListBlock>
</j:scope>
</j:forEach>
</f:dropdownList>
<f:dropdownDescriptorSelector title="${%Choice Provider}" field="choiceListProvider" descriptors="${descriptor.enabledChoiceListProviderList}" />
<f:entry title="${%Editable}" field="editable">
<f:checkbox />
</f:entry>
Expand Down

0 comments on commit 4273077

Please sign in to comment.