return this._selected; if (this._selected == val) return; if (this._selected) this._selected.setActive(false); this._selected = val.QueryInterface(Components.interfaces.nsIXFormsItemElement); if (this._selected) { this._selected.setActive(true); this.updateInputField(); this._handleSelection(true); } return this.popupOpen; if (val) this.showPopup(); else this.hidePopup(); null null null null -1 null null null false true false return this.getAttribute("selection") == "open"; if (!this._inputField) { this._inputField = document.getAnonymousElementByAttribute(this, "anonid", "control"); } return this._inputField; if (!this._dropMarker) { this._dropMarker = document.getAnonymousElementByAttribute(this, "anonid", "dropmarker"); } return this._dropMarker; if (!this._popup) { this._popup = document.getAnonymousElementByAttribute(this, "anonid", "popup"); } return this._popup; if (!this._container) { this._container = document.getAnonymousElementByAttribute(this, "anonid", "container"); } return this._container; . No need to update the value of the control // in this case. if (this._selected && this.popupOpen) { this.hidePopup(); this._selected.setActive(false); this._selected = this._tmpSelected; this._tmpSelected = null; if (this._selected) { this._selected.setActive(true); } } } else if (aEvent.charCode && !this.selectionOpen) { // Cache sequence of last pressed keys and search it in value of // xforms:label inside xforms:item elements. var currtime = new Date().valueOf(); var char = String.fromCharCode(aEvent.charCode); if (currtime - this.searchKeypressTime <= 1000) this.searchValue += char; else this.searchValue = char; this.selectItemByLabel(this.searchValue); this.searchKeypressTime = currtime; } return true; ]]> "" 0 0) { return aDown ? next.anonymousItemSetContent.firstChild : next.anonymousItemSetContent.lastChild; } } node = next; } // if we are in a choices or itemset element var parent = aNode.parentNode; if (parent.namespaceURI == this.XFORMS_NS && parent.localName == "choices") { var sibling = aDown ? parent.nextSibling : parent.previousSibling; if (sibling.namespaceURI == this.XFORMS_NS && sibling.localName == "item") { return sibling; } return this.findNextSelectable(sibling, aDown); } if (parent.parentNode.namespaceURI == this.XFORMS_NS && parent.parentNode.localName == "itemset") { var sibling2 = aDown ? parent.parentNode.nextSibling : parent.parentNode.previousSibling; if (sibling2.namespaceURI == this.XFORMS_NS && sibling2.localName == "item") { return sibling2; } return this.findNextSelectable(sibling2, aDown); } return null; ]]> is possible (anonymously) // inside var target = aEvent.originalTarget; while (target && target != this) { if (target.namespaceURI == this.XFORMS_NS && (target.localName == "item" || target.localName == "choices")) { break; } target = target.parentNode; } if (target == this) { return true; } this.hidePopup(); if (this._selected) { this.updateInputField(); if (this.incremental) { this._handleSelection(true); } else { this.dispatchSelectEvents(); } } this.inputField.focus(); ]]> is possible (anonymously) // inside var target = aEvent.originalTarget; while (target && target != this) { if (target.namespaceURI == this.XFORMS_NS && target.localName == "item") { if (this._selected) { this._selected.setActive(false); this._selected = null; } var item = target.QueryInterface(Components.interfaces.nsIXFormsItemElement); if (item) { item.setActive(true); this._selected = item; } break; } target = target.parentNode; } ]]> 0) { w = w + 12; // Adding some 'padding' for possible scrollbar this.inputField.setAttribute("style", "width:" + w + "px;"); this._width = w + document.getBoxObjectFor(this.dropMarker).width; } this.popup.style.maxHeight = "10px"; this.popup.style.left = "0px"; this.popup.style.top = "0px"; } ]]> this.popup.style.visibility = "hidden"; this.popupOpen = false; popupHeight) { targetY = y - popupHeight; } else if (belowSelect < (y - pY)) { style = style + "max-height:" + (y - pY - adjust) + "px;"; targetY = pY + adjust; } else { style = style + "max-height:" + belowSelect + "px;"; } } style = style + "left:" + x + "px;"; style = style + "top:" + targetY + "px;"; style = style + "width:"; if (this.selectionOpen) { style = style + w + "px;"; } else if (this._width < 0) { style = style + "auto;" } else { style = style + this._width + "px;"; } style = style + "visibility:visible;"; this.popup.setAttribute("style", style); this.popupOpen = true; this._tmpSelected = this._selected; if (this._selected) { var el = this._selected.QueryInterface(Components.interfaces.nsIDOMElement); if ("scrollIntoView" in el) { el.scrollIntoView(false); } } ]]> if (!this.popupOpen) this.showPopup(); else this.hidePopup(); this.inputField.focus(); return true; throw Components.results.NS_ERROR_NOT_IMPLEMENTED; if (this.popupOpen) { this.hidePopup(); if (this._selected) this._selected.setActive(false); this._selected = this._tmpSelected; this._tmpSelected = null; if (this._selected) this._selected.setActive(true); } } null if (!this._content) { this._content = document.getAnonymousElementByAttribute(this, "anonid", "content"); } return this._content; // this.content is null if anonymous content hasn't been created yet. var content = this.content; if (content) { content.scrollIntoView(aTop); }