Skip to content
Permalink
Browse files
[FIXED JENKINS-22570] On a configure screen that has multiple groups …
…of radio buttons, clicking the apply button clears all but the last radio group selection

- Changed from mutating the e.name value to maintaining an index and using that index to get the required substring

- Risk of unintended consequences is low. The Submit flow moves off the page before the consequences of the effect
  could be seen... though a careful attention to the page submit can identify the change... and the page is now
  left as before clicking f:apply instead of mutated.
  • Loading branch information
stephenc committed Apr 10, 2014
1 parent d46b17e commit 88d84f6e9b2f05366bc8e6f4bc62ac61e7211926
Showing with 5 additions and 3 deletions.
  1. +5 −3 war/src/main/webapp/scripts/hudson-behavior.js
@@ -1814,6 +1814,7 @@ function buildFormTree(form) {
}

var p;
var r;
var type = e.getAttribute("type");
if(type==null) type="";
switch(type.toLowerCase()) {
@@ -1861,11 +1862,12 @@ function buildFormTree(form) {
break;
case "radio":
if(!e.checked) break;
while (e.name.substring(0,8)=='removeme')
e.name = e.name.substring(e.name.indexOf('_',8)+1);
r=0;
while (e.name.substring(r,r+8)=='removeme')
r = e.name.indexOf('_',r+8)+1;
if(e.groupingNode) {
p = findParent(e);
addProperty(p, e.name, e.formDom = { value: e.value });
addProperty(p, e.name.substring(r), e.formDom = { value: e.value });
break;
}

0 comments on commit 88d84f6

Please sign in to comment.