Opened 12 years ago

Closed 12 years ago

#3004 closed defect (fixed)

[InlineEditBox] Work with Select

Reported by: haysmark Owned by: haysmark
Priority: high Milestone: 0.9beta
Component: Widgets Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

Make onValueChanged always listen for a value changing. Make Select set its value after InlineEditBox? is listening.

InlineEditBox?:

	postCreate: function(){
		var _this = this;
		dojo.addOnLoad(function(){
			// look for the input widget as a child of the containerNode
			if(_this.editWidget){
				_this.containerNode.appendChild(_this.editWidget.domNode);
			}else{
				var node = _this.containerNode.firstChild;
				while(node != null){
					_this.editWidget = dijit.util.manager.byNode(node);
					if(_this.editWidget){
						break;
					}
					node = node.nextSibling;
				}
			}
			_this._setEditValue = dojo.hitch(_this.editWidget,_this.editWidget.setTextValue||_this.editWidget.setValue);
			_this._getEditValue = dojo.hitch(_this.editWidget,_this.editWidget.getTextValue||_this.editWidget.getValue);
			_this._setEditFocus = dojo.hitch(_this.editWidget,_this.editWidget.focus);
			_this.editWidget.onValueChanged = dojo.hitch(_this,"checkForValueChange");
			_this._showText();
		});
	},
	checkForValueChange: function(){
		// summary
		//		Callback when user changes input value.
		//		Enable save button if the text value is different than the original value.
		if(this.editing){
			this.saveButton.disabled = (this._getEditValue() == this._initialText);
		}

		else{
			this._showText();
		}

	},

Select:

		postCreate: function(){
			this.comboBoxSelectionValue = document.createElement('input');
			this.comboBoxSelectionValue.setAttribute("type", "hidden");
			this.comboBoxSelectionValue.setAttribute("tabindex", -1);
			this.comboBoxSelectionValue.setAttribute("name", this.name);
			this.comboBoxSelectionValue.setAttribute("value", "");
			this.comboBoxSelectionValue.setAttribute("dojoAttachPoint","comboBoxSelectionValue");
			this.domNode.appendChild(this.comboBoxSelectionValue);
			dijit.form.Select.superclass.postCreate.apply(this, arguments);
			this.textbox.removeAttribute("name");
			var _this=this;
			dojo.addOnLoad(function(){
				_this.setValue(_this.value);
			});

		},

Change History (1)

comment:1 Changed 12 years ago by bill

Resolution: fixed
Status: newclosed

(In [8618]) (proxy checkin for Mark Hays, IBM, CCLA on file) Fixes #2935, #2938, #2962, #2992, #2936, #2937, #2977, #2981, #2999, #3000, #3004, #2812 Adds new popup code, only one Calendar for all DateTextboxes?, only one menu for AutoCompleters/Selects?. DateTextbox? works with new dijit._Calendar. DateTextbox? carries over min/max to the Calendar. All files much more consistent with the Dojo style guidelines.

Note: See TracTickets for help on using tickets.