rem: gFilterTree.clearSelection(); gFilterTree.setAttribute("ref", gFilterTree.getAttribute("ref"));  if (selection) { var newItem = document.getElementById(selection);   if (newItem) { gFilterTree.selectItem(newItem); gFilterTree.ensureElementIsVisible(newItem); 
add:  if (selectedRes) { var previousSel = gFilterTree.builderView.getIndexOfResource(selectedRes); if (previousSel >= 0) {  gFilterTree.treeBoxObject.selection.select(previousSel); gFilterTree.treeBoxObject.ensureRowIsVisible(previousSel); 
context: function refreshFilterList() {    if (!gFilterTree)       return;    var selection;    var selectedItems = gFilterTree.selectedItems;    if (selectedItems && selectedItems.length >0)        selection = gFilterTree.selectedItems[0].id;    gFilterTree.clearSelection();    gFilterTree.setAttribute("ref", gFilterTree.getAttribute("ref"));    if (selection) {        var newItem = document.getElementById(selection);        // sometimes the selected element is gone.        if (newItem) {            gFilterTree.selectItem(newItem);            gFilterTree.ensureElementIsVisible(newItem);        }    }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/07d96867f11683becf5e1a6ca5e64e6a9324c957/FilterListDialog.js/buggy/mailnews/base/search/resources/content/FilterListDialog.js