function tomCombobox(obj) { this.id = obj.getAttribute("id2"); this.combo = obj.getElementsByTagName("select")[0]; this.ext = this.combo.getAttribute("ext"); var obj = this; this.combo.onchange = function () { obj.value = this.value; obj.Click(obj.value) } } tomCombobox.prototype.load = function(capt) { if(getWert(capt)=="") capt = "wird geladen .."; this.combo.innerHTML = ""; var data = "web="+web.webname+"&nam="+this.ext; xmlhttp("/_gui/_ components/combobox/xCombobox.asp",data,this.doneload,'',this); } tomCombobox.prototype.doneload = function(ret) { dodebug(ret); if(check4Error("combobox.doneload",ret)) return; this.combo.innerHTML = ""; var items = ret.split("|"); this.listcount = items.length-1; for(i=0;i < items.length-1;i++) { var item = items[i].split("^"); var tx = item[0]; var valu = item[1]; var nuItem = new Option(tx, valu, false, false); this.combo.options[this.combo.length] = nuItem; } this.value = this.combo.value; if(this.gui[this.id+"_doneLoad"]) this.gui[this.id+"_doneLoad"](); } tomCombobox.prototype.setListindex = function(valu) { this.combo.selectedIndex = valu; } tomCombobox.prototype.listindex = function() { return(this.combo.selectedIndex); } tomCombobox.prototype.addItem = function(txt,valu) { var comb = gEL(obj.id); var item = comb.options[comb.lentgh]; item.text = txt; item.value = valu; } tomCombobox.prototype.setListindexbyValu = function(valu) { setComboValue(this.combo,valu); } tomCombobox.prototype.Click = function(valu) { this.value = this.combo.value; if(this.gui[this.id+"_Click"]) this.gui[this.id+"_Click"](valu); } function setComboValue(combo,valu) { var items = combo.options; for(i=0;i < items.length;i++) { if(items[i].value == valu) { combo.selectedIndex = i; break; } } }