rem: gDialog.charsetTree.selectItem(selectedItem); gDialog.charsetTree.ensureElementIsVisible(selectedItem); 
add: var index = gDialog.charsetTree.contentView.getIndexOfItem(selectedItem); gDialog.charsetTree.treeBoxObject.selection.select(index); gDialog.charsetTree.treeBoxObject.ensureRowIsVisible(index); 
context: function LoadAvailableCharSets(){  try   {                                      var rdf=Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);    var kNC_Root = rdf.GetResource("NC:DecodersRoot");    var kNC_name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name");    var rdfDataSource = rdf.GetDataSource("rdf:charset-menu");    var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer);    rdfContainer.Init(rdfDataSource, kNC_Root);    var availableCharsets = rdfContainer.GetElements();    var charsetNode;    var selectedItem;    var item;    ClearTreelist(gDialog.charsetTree);    for (var i = 0; i < rdfContainer.GetCount(); i++) 	{      charsetNode = availableCharsets.getNext().QueryInterface(Components.interfaces.nsIRDFResource);      item = AppendStringToTreelist(gDialog.charsetTree, readRDFString(rdfDataSource, charsetNode, kNC_name));      item.firstChild.firstChild.setAttribute("value", charsetNode.Value);      if(charset == charsetNode.Value)         selectedItem = item;    }    if(selectedItem) 	{      gDialog.charsetTree.selectItem(selectedItem);      gDialog.charsetTree.ensureElementIsVisible(selectedItem);    }  }  catch(e) {}}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/d38a0937d9c93a0a9d913e2ac781e4328bb8cc73/EditorSaveAsCharset.js/buggy/editor/ui/dialogs/content/EditorSaveAsCharset.js