Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5028

Collision between radioBlocks when used in a Builder

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • core
    • None

    Description

      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.

      Attachments

        Activity

          People

            mindless Alan Harder
            rseguy Romain Seguy
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: