add: var branchBox = document.getElementById('editform_branch'); var options = branchBox.getElementsByTagName('option'); var found_branch = 0; for (var i=0; i<options.length; i++) { if (options[i].value == testgroup.branch_id.branch_id) { options[i].selected = true; document.getElementById('branch_text').innerHTML = options[i].text; found_branch=1; } else { options[i].selected = false; } } if (found_branch == 0) { document.getElementById('branch_text').innerHTML = '<em>No branch set for this testgroup.</em>'; options[0].selected = true; }  
context: function populateTestgroup(data) {  testgroup=data;  document.getElementById('editform_testgroup_id').value = testgroup.testgroup_id;  document.getElementById('editform_testgroup_id_display').innerHTML = testgroup.testgroup_id;  document.getElementById('editform_name').value = testgroup.name;  document.getElementById('name_text').innerHTML = testgroup.name;  document.getElementById('testgroup_id_display').innerHTML = testgroup.testgroup_id;  var productBox = document.getElementById('product');  var options = productBox.getElementsByTagName('option');    var found_product = 0;  for (var i=0; i<options.length; i++) {    if (options[i].value == testgroup.product_id.product_id) {      options[i].selected = true;      document.getElementById('product_text').innerHTML = options[i].text;      found_product=1;    } else {      options[i].selected = false;    }        }  if (found_product == 0) {    options[0].selected = true;  }  changeProduct();  populateBranches(productBox);  var enabled_em = document.getElementById('editform_enabled')  if (testgroup.enabled == 1) {    enabled_em.checked = true;  } else {    enabled_em.checked = false; }   document.getElementById('editform_testrunner_plan_id').innerHTML = testgroup.testrunner_plan_id;  populateAllSubgroups();  var selectBoxTestgroup = document.getElementById('editform_testgroup_subgroups');  selectBoxTestgroup.options.length = 0;  for (var i=0; i<testgroup.subgroups.length; i++) {    var optionText = testgroup.subgroups[i].name + ' (' + testgroup.subgroups[i].subgroup_id + ')';     selectBoxTestgroup.options[selectBoxTestgroup.length] = new Option(optionText,                                                     testgroup.subgroups[i].subgroup_id);  }  document.getElementById('editform_div').style.display = 'none';  document.getElementById('testgroup_display_div').style.display = 'block';  enableModeButtons();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/38cc2c83c0a981088028f4bb46905c61fc4ecda5/ManageTestgroups.js/buggy/webtools/litmus/js/ManageTestgroups.js