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

Collision between radioBlocks when used in a Builder

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      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

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : mindless
          Path:
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/29096
          Log:
          [FIXED JENKINS-5028] add link to existing issue fixed by r29065

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/www/changelog.html http://jenkins-ci.org/commit/29096 Log: [FIXED JENKINS-5028] add link to existing issue fixed by r29065
          Hide
          mindless Alan Harder added a comment -

          Please do test this when 1.353 comes out.. I did a quick test and it look OK, but most of my testing while working on this fix was with f:repeatable, and build steps are going through f:hetero-list.

          Show
          mindless Alan Harder added a comment - Please do test this when 1.353 comes out.. I did a quick test and it look OK, but most of my testing while working on this fix was with f:repeatable, and build steps are going through f:hetero-list.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/test/src/test/java/lib/form/RepeatableTest.java
          trunk/hudson/main/test/src/test/resources/lib/form/RepeatableTest/testNested.jelly
          trunk/hudson/main/test/src/test/resources/lib/form/RepeatableTest/testNestedRadio.jelly
          trunk/hudson/main/war/resources/scripts/hudson-behavior.js
          http://jenkins-ci.org/commit/29170
          Log:
          JENKINS-5028 expand radiobutton support in repeatable content
          to work in nested repeatables.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/test/src/test/java/lib/form/RepeatableTest.java trunk/hudson/main/test/src/test/resources/lib/form/RepeatableTest/testNested.jelly trunk/hudson/main/test/src/test/resources/lib/form/RepeatableTest/testNestedRadio.jelly trunk/hudson/main/war/resources/scripts/hudson-behavior.js http://jenkins-ci.org/commit/29170 Log: JENKINS-5028 expand radiobutton support in repeatable content to work in nested repeatables.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/war/resources/scripts/hudson-behavior.js
          http://jenkins-ci.org/commit/29202
          Log:
          JENKINS-5028 reselect any radiobuttons unselected by browser before names uniquified

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/war/resources/scripts/hudson-behavior.js http://jenkins-ci.org/commit/29202 Log: JENKINS-5028 reselect any radiobuttons unselected by browser before names uniquified
          Hide
          rseguy Romain Seguy added a comment -

          OK, I'll do the test with the Groovy plugin which has the "bug" built inside

          Show
          rseguy Romain Seguy added a comment - OK, I'll do the test with the Groovy plugin which has the "bug" built inside
          Hide
          rseguy Romain Seguy added a comment -

          The Groovy plugin works fine with 1.353: It's new possible to add several times the build step.

          Show
          rseguy Romain Seguy added a comment - The Groovy plugin works fine with 1.353: It's new possible to add several times the build step.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: