false throw Components.results.NS_ERROR_NOT_IMPLEMENTED; return this.getAttribute("selection"); this.setAttribute("selection", val); if (val == "open") this.control.allowFreeEntry(true); else this.control.allowFreeEntry(false); // cache the item's label/value aItem = aItem.QueryInterface(Components.interfaces.nsIXFormsItemElement); var labels = aItem.getElementsByTagNameNS(this.XFORMS_NS, "label"); var controlitem; if (labels[0]) { controlitem = this.control. appendItem(labels[0].nodeValue, aItem.value, aParentGroup); } else { controlitem = this.control. appendItem(null, aItem.value, aParentGroup); } var selected = false; if (aItem.value in this._defaultHash) { selected = true; this.control.addItemToSelection(controlitem); this._defaultHash[aItem.value].hits++; } this._controlArray.push( {control: aItem, option: controlitem, wasSelected: selected} ); 0) { item = item.QueryInterface(Components.interfaces.nsIXFormsSelectChild); for (var j = 0; j < this._selectedElementArray.length; j++ ) { var selectedItem = item.selectItemByNode(this._selectedElementArray[j].element); if (selectedItem) { this.control.addItemToSelection(controlitem); selected = true; this._selectedElementArray[j].hits++; // XXX It is possible that two identical elements are under the // bound node. I guess we shouldn't mark one and not the other // if there is an item in the select that matches it. So we'll // go through the whole list. But this is quite an edge case // and will cause more inefficiency just to prevent an errant // xforms-out-of-range. } } } if (!copyItem) { if (item.value in this._defaultHash) { this.control.addItemToSelection(controlitem); selected = true; this._defaultHash[item.value].hits++; } } this._controlArray.push( {control: item, option: controlitem, wasSelected: selected} ); } ]]> 0) { selectedValues += " "; } var item = options[i].control. QueryInterface(Components.interfaces.nsIXFormsItemElement); if (item.isCopyItem) { if (boundType && (boundType != Node.ELEMENT_NODE)) { // if we are trying to do a copy without being bound to an // element node, then we need to throw a binding exception // per spec. var bindingException = document.createEvent("Events"); bindingException.initEvent("xforms-binding-exception", true, false); this.dispatchEvent(bindingException); // we should probably un-select the option so that the list // of selected data is accurate. This WON'T cause a // xforms-select/deselect to fire. Since the user just // selected this item and we are automatically deselecting // it from underneath the user, we'll treat it like nothing // happened. this.control.removeItemFromSelection(options[i].option); } else { copyNode = item.copyNode; if (copyNode) { var clone = copyNode.cloneNode(true); contentEnvelope.appendChild(clone); if (!options[i].wasSelected) { if (aIsACopyItemSelectedOrDeselected && aIsACopyItemSelectedOrDeselected.value != true) { aIsACopyItemSelectedOrDeselected.value = true; } } } } } else { // not a copyItem, so grab the item's value and append it to our // space seperated list. selectedValues += options[i].control. QueryInterface(Components.interfaces.nsIXFormsSelectChild).value; } } else { // it was selected before, but now unselected if (options[i].wasSelected) { // if a copyItem was deselected, we need to make sure to do a // rebuild. By setting aIsACopyItemSelectedOrDeselected, this // should tell _handleSelection to use setContent with // aForceUpdate = true var item = options[i].control. QueryInterface(Components.interfaces.nsIXFormsItemElement); if (item.isCopyItem) { if (aIsACopyItemSelectedOrDeselected && aIsACopyItemSelectedOrDeselected.value != true) { aIsACopyItemSelectedOrDeselected.value = true; } } } } } // write out the text nodes before we handle copy if (boundType == Node.ELEMENT_NODE) { if (selectedValues.length > 0) { var textNode = document.createTextNode(selectedValues); if (copyNode) { // making sure all selected 'values' are in the first text node // under the bound node. var firstChild = contentEnvelope.firstChild; contentEnvelope.insertBefore(textNode, firstChild); } else { contentEnvelope.appendChild(textNode); } } } else { contentEnvelope.nodeValue = selectedValues; } this._dispatchSelectEvents(); return contentEnvelope; ]]> var ev = document.createEvent("Events"); ev.initEvent(aName, true, false); var elm = aElement; // per http://www.w3.org/TR/2005/PER-xforms-20051006/index-all.html#evt-select // we send the event to the itemset if it is a parent. if (elm.parentNode.localName == "itemset") elm = elm.parentNode; elm.dispatchEvent(ev); return true; new Array() new Array() null null false return document.getAnonymousElementByAttribute(this, "anonid", "control"); null if (!this._control) { this._control = document.getAnonymousElementByAttribute(this, "anonid", "control"); } return this._control; null return this.getAttribute("readonly") == "true" ? true : false; if (val) { this.setAttribute("readonly", "true"); } else { this.removeAttribute("readonly"); } this.control.focus(); this.parentControl.dispatchDOMUIEvent(aType); return ""; if (this.parentControl.selection == "open") this.allowFreeEntry(true); else this.allowFreeEntry(false); null if (this.isItemElement(event.originalTarget)) this.currentItem = event.originalTarget;