if (text != null || value) ele.options[ele.options.length] = new Option(text, value); 
if (options.text != null || options.value) { var opt = options.optionCreator(options); opt.text = options.text; opt.value = options.value; ele.options[ele.options.length] = opt; } 
dwr.util.addOptions = function(ele, data/*, options*/) {  ele = dwr.util._getElementById(ele, "addOptions()");  if (ele == null) return;  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 {        value = dwr.util._getValueFrom(data[i], arguments[2]);        if (value != null) {          li = document.createElement("li");          if (dwr.util._shouldEscapeHtml(arguments[3])) {            value = dwr.util.escapeHtml(value);          }          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, null); // TODO: forward options instead of null };
266	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/266/203b2dfdd0cbd30d8b5d49bf88dd3946300f825b/util.js/buggy/java/org/directwebremoting/util.js