%xformsDTD; ]> return { __proto__: this.ownerDocument. getAnonymousElementByAttribute(this, 'anonid', 'control'), set readonly(val) { if (val) { this.setAttribute('readonly', 'readonly'); } else { this.removeAttribute('readonly'); } } }; if (event.originalTarget == this.control) { this.dispatchDOMUIEvent("DOMFocusIn"); } if (event.originalTarget == this.control) { this.updateInstanceData(); this.dispatchDOMUIEvent("DOMFocusOut"); } return { __proto__: this.ownerDocument. getAnonymousElementByAttribute(this, 'anonid', 'control'), get value() { return this.checked; }, set value(val) { this.checked = val; }, set readonly(val) { if (val) { this.setAttribute('disabled', 'disabled'); } else { this.removeAttribute('disabled'); } } }; if (event.originalTarget == this.control) this.updateInstanceData(true); if (event.originalTarget == this.control) { this.dispatchDOMUIEvent("DOMFocusIn"); } if (event.originalTarget == this.control) { this.updateInstanceData(); this.dispatchDOMUIEvent("DOMFocusOut"); } return { __proto__: this.inputField, pickerButton: this.dropmarker, set readonly(val) { if (val) { this.setAttribute('disabled', 'disabled'); this.pickerButton.setAttribute('disabled', 'disabled'); } else { this.removeAttribute('disabled'); this.pickerButton.removeAttribute('disabled'); } } }; if (this._isPickerVisible) this.hidePicker(true); else this.showPicker(); windowWidth) { if (relative) { // Can't base our position on the window width since our position // will be set relative to the offsetParent. So let's set the // position to be the left-most part of the button that triggers // the dropdown. We'll assume that at least that much of the // button is visible since the user navigated to it and triggered // it. position = this.dropmarker.offsetLeft - pickerWidth; } else { position = windowWidth - pickerWidth; } } this.picker.style.left = position + "px"; this.picker.focus(); this.ownerDocument. addEventListener("blur", this.hidePickerHandler, true); this.ownerDocument. addEventListener("focus", this.hidePickerHandler, true); ]]> null // Add event handlers to update instance data when date picker value is // changed. // Add event handler on 'change' event. var changePickerValueHandlerOnChange = { inputElm: this, handleEvent: function(event) { this.inputElm.inputField.value = this.inputElm.picker.value; this.inputElm.hidePicker(true); this.inputElm.updateInstanceData(true); } }; this.picker.addEventListener("change", changePickerValueHandlerOnChange, false); // Add event handler on 'enter' key pressing. var changePickerValueHandlerOnKeypress = { inputElm: this, pickerElm: this.picker, handleEvent: function(event) { if (event.keyCode != event.DOM_VK_RETURN || !this.pickerElm.isDayControl(event.originalTarget)) return; var date = this.pickerElm.getDate(); if (date) { this.inputElm.inputField.value = date.toLocaleFormat('%Y-%m-%d'); this.inputElm.hidePicker(true); this.inputElm.updateInstanceData(true); } } }; this.picker.addEventListener("keypress", changePickerValueHandlerOnKeypress, false); if (!this._inputField) { this._inputField = document.getAnonymousElementByAttribute(this, "anonid", "control"); } return this._inputField; null if (!this._picker) { this._picker = document.getAnonymousElementByAttribute(this, "anonid", "picker"); } return this._picker; null if (!this._dropmarker) { this._dropmarker = document.getAnonymousElementByAttribute(this, "anonid", "dropmarker"); } return this._dropmarker; null false this.hidePicker(true); var target = event.originalTarget; if (target == this.inputField) { this.dispatchDOMUIEvent('DOMActivate'); } this.updateInstanceData(true); if (event.originalTarget == this.dropmarker) { this.togglePicker(); } if (event.originalTarget == this.inputField) { this.dispatchDOMUIEvent('DOMFocusIn'); } if (event.originalTarget == this.inputField) { this.updateInstanceData(false); this.dispatchDOMUIEvent('DOMFocusOut'); } return this.ownerDocument. getAnonymousElementByAttribute(this, "anonid", "control"); var changeHandler = { inputControl: this, handleEvent: function() { this.inputControl.updateInstanceData(false); } }; this.addEventListener("change", changeHandler, false); return { __proto__: this.ownerDocument. getAnonymousElementByAttribute(this, 'anonid', 'control'), XHTML_NS: 'http://www.w3.org/1999/xhtml', set readonly(val) { this.disabled = val; }, appendMonth: function(name, value) { var option = this.ownerDocument. createElementNS(this.XHTML_NS, 'option'); option.textContent = name; option.setAttribute('value', value); this.appendChild(option); } }; if (event.originalTarget == this.control) this.updateInstanceData(false); if (event.originalTarget == this.control) this.updateInstanceData(true); return { __proto__: this.ownerDocument. getAnonymousElementByAttribute(this, 'anonid', 'control'), XHTML_NS: 'http://www.w3.org/1999/xhtml', set readonly(val) { this.disabled = val; }, appendDay: function(name, value) { var option = this.ownerDocument. createElementNS(this.XHTML_NS, 'option'); option.textContent = name; option.setAttribute('value', value); this.appendChild(option); } }; if (event.originalTarget == this.control) this.updateInstanceData(false); if (event.originalTarget == this.control) this.updateInstanceData(true); return { __proto__: this.ownerDocument. getAnonymousElementByAttribute(this, 'anonid', 'control'), set readonly(val) { if (val) { this.setAttribute('readonly', 'readonly'); } else { this.removeAttribute('readonly'); } } }; if (event.originalTarget == this.control) { this.dispatchDOMUIEvent("DOMFocusIn"); } if (event.originalTarget == this.control) { this.updateInstanceData(); this.dispatchDOMUIEvent("DOMFocusOut"); }