rem: viewPicker.value = gLastDefaultViewIndex + aDefaultSelectedIndex; gCurrentViewValue = viewPicker.value; LoadCustomMailView(aDefaultSelectedIndex); 
add: viewPicker.selectedItem = document.getElementsByAttribute("value", kLastDefaultViewIndex + aDefaultSelectedIndex)[0]; viewChange(viewPicker); 
context: function refreshCustomMailViews(aDefaultSelectedIndex){  // for each mail view in the msg view list, add an entry in our combo box  if (!gMailViewList)    gMailViewList = Components.classes["@mozilla.org/messenger/mailviewlist;1"].getService(Components.interfaces.nsIMsgMailViewList);  // remove any existing entries...  var menupopupNode = document.getElementById('viewPickerPopup');  var numItemsInNode = menupopupNode.childNodes.length;  numItemsInNode -= 2; // subtract off the last 2 items since we want to leave those  var removeNodes = true;  while (removeNodes && numItemsInNode)  {    if (menupopupNode.childNodes[numItemsInNode-1].getAttribute('id') == 'lastDefaultView')      removeNodes = false;    else      menupopupNode.removeChild(menupopupNode.childNodes[numItemsInNode-1]);    numItemsInNode -= 1;  }   // now rebuild the list  var numItems = gMailViewList.mailViewCount;   var customNode = document.getElementById('createCustomViewSeparator');  var newMenuItem;   var item;   for (var index = 0; index < numItems; index++)  {    newMenuItem = document.createElement('menuitem');    newMenuItem.setAttribute('label', gMailViewList.getMailViewAt(index).mailViewName);    item = menupopupNode.insertBefore(newMenuItem, customNode);    item.setAttribute('value',  gLastDefaultViewIndex + index);  }  if (!numItems)    customNode.setAttribute('collapsed', true);  else    customNode.removeAttribute('collapsed');  if (aDefaultSelectedIndex >= 0)  {    var viewPicker = document.getElementById('viewPicker');    viewPicker.value = gLastDefaultViewIndex + aDefaultSelectedIndex;    gCurrentViewValue = viewPicker.value;    LoadCustomMailView(aDefaultSelectedIndex);  }}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/f7bbce7579986d8b306959f630104b7fb01e18ca/msgViewPickerOverlay.js/buggy/mailnews/extensions/mailviews/resources/content/msgViewPickerOverlay.js