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

Collision between radioBlocks when used in a Builder

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • 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.

          [JENKINS-5028] Collision between radioBlocks when used in a Builder

          Romain Seguy created issue -
          mdonohue made changes -
          Component/s New: gui [ 15492 ]
          Component/s Original: core [ 15593 ]
          Alan Harder made changes -
          Assignee New: Alan Harder [ mindless ]
          Alan Harder made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Romain Seguy made changes -
          Status Original: Resolved [ 5 ] New: Verified [ 10000 ]
          Romain Seguy made changes -
          Status Original: Verified [ 10000 ] New: Closed [ 6 ]
          Jenkins IRC Bot made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: gui [ 15492 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 135112 ] New: JNJira + In-Review [ 203268 ]

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

              Created:
              Updated:
              Resolved: