rem: dwr.util.addOptions = function(ele, data, options) { 
add: dwr.util.addOptions = function(ele, data/*, options*/) { 
context: dwr.util.addOptions = function(ele, data, options) {  ele = dwr.util._getElementById(ele, "addOptions()");  if (ele == null) return;  if (options == null) options = {};  var useOptions = dwr.util._isHTMLElement(ele, "select");  var useLi = dwr.util._isHTMLElement(ele, ["ul", "ol"]);  if (!useOptions && !useLi) {    dwr.util._debug("addOptions() can only be used with select/ul/ol elements. Attempt to use: " + dwr.util._detailedTypeOf(ele));    return;  }  if (data == null) return;  var text, value, li;  if (dwr.util._isArray(data)) {    // Loop through the data that we do have    for (var i = 0; i < data.length; i++) {      if (useOptions) {        if (arguments[2] != null) {          if (arguments[3] != null) {            text = dwr.util._getValueFrom(data[i], arguments[3]);            value = dwr.util._getValueFrom(data[i], arguments[2]);          }          else text = value = dwr.util._getValueFrom(data[i], arguments[2]);        }        else text = value = dwr.util._getValueFrom(data[i], arguments[3]);        if (text != null || value) ele.options[ele.options.length] = new Option(text, value);      }      else {        li = document.createElement("li");        value = dwr.util._getValueFrom(data[i], arguments[2]);        if (value != null) {          li.innerHTML = value;          ele.appendChild(li);        }      }    }  }  else if (arguments[3] != null) {    if (!useOptions) {      alert("dwr.util.addOptions can only create select lists from objects.");      return;    }    for (var prop in data) {      value = dwr.util._getValueFrom(data[prop], arguments[2]);      text = dwr.util._getValueFrom(data[prop], arguments[3]);      if (text || value) ele.options[ele.options.length] = new Option(text, value);    }  }  else {    if (!useOptions) {      dwr.util._debug("dwr.util.addOptions can only create select lists from objects.");      return;    }    for (var prop in data) {      if (typeof data[prop] != "function") {        if (arguments[2]) ele.options[ele.options.length] = new Option(prop, data[prop]);        else ele.options[ele.options.length] = new Option(data[prop], prop);      }    }  }  // All error routes through this function result in a return, so highlight now  dwr.util.highlight(ele, options);};
meta: 266	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/266/44933462504ef64d0d87af65a9086f71301913de/util.js/clean/java/org/directwebremoting/util.js