-
Bug
-
Resolution: Fixed
-
Major
-
None
Consider the following in the config.jelly file for a BuildStep implementation:
<f:block>
<f:radioBlock name="commandsOrScriptFile" value="commands" title="${%Run a set of commands}" checked="${!empty instance.commands}">
<f:entry title="${%Commands}" field="commands">
<f:expandableTextbox name="wasbuildstep.commands" value="${instance.commands}"/>
</f:entry>
</f:radioBlock>
<f:radioBlock name="commandsOrScriptFile" value="scriptFile" title="${%Run a script file}" checked="${!empty instance.scriptFile}">
<f:entry title="${%Script file}" field="scriptFile">
<f:textbox name="wasbuildstep.scriptFile" value="${instance.scriptFile}"/>
</f:entry>
</f:radioBlock>
</f:block>
This would render as shown in the attached screenshot.
This code works fine when the builder is used just once. But when the builder is used twice or more in the same job, the ids/names of the radio buttons conflict: If the radio button of builder #n is selected, then the radio buttons of all other similar builders are unchecked, and vice-versa.
The point is that the addRadioBlock() function in hudson-behavior.js is called only once, when the config page of the job gets loaded, so there's no way to tweak the ids/names there.