Changeset 13989
- Timestamp:
- 06/12/08 19:07:26 (5 months ago)
- Location:
- dijit/trunk
- Files:
-
- 3 modified
-
form/ComboBox.js (modified) (1 diff)
-
form/FilteringSelect.js (modified) (5 diffs)
-
tests/form/test_FilteringSelect.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/form/ComboBox.js
r13979 r13989 1064 1064 // See dojo.data.util.simpleFetch.fetch() 1065 1065 if(!args.query){ args.query = {}; } 1066 if(!args.query.name){ args.query.name = " *"; }1066 if(!args.query.name){ args.query.name = ""; } 1067 1067 if(!args.queryOptions){ args.queryOptions = {}; } 1068 1068 var query = "^" + args.query.name -
dijit/trunk/form/FilteringSelect.js
r13269 r13989 30 30 _isvalid:true, 31 31 32 required:true, 33 32 34 _lastDisplayedValue: "", 33 35 34 36 isValid:function(){ 35 return this._isvalid ;37 return this._isvalid || (!this.required && this.getDisplayedValue() == ""); // #5974 36 38 }, 37 39 … … 46 48 // so it calls _callbackSetLabel directly, 47 49 // and so does not pass dataObject 48 // dataObject==null means do not test the lastQuery, just continue49 if( dataObject && dataObject.query[this.searchAttr] != this._lastQuery){50 // still need to test against _lastQuery in case it came too late 51 if((dataObject && dataObject.query[this.searchAttr] != this._lastQuery)||(!dataObject&&this.store.getIdentity(result[0])!= this._lastQuery)){ 50 52 return; 51 53 } … … 55 57 //#3285: change CSS to indicate error 56 58 if(!this._focused){ this.valueNode.value=""; } 57 dijit.form.TextBox.superclass.setValue.call(this, undefined, !this._focused);59 dijit.form.TextBox.superclass.setValue.call(this, "", !this._focused); 58 60 this._isvalid=false; 59 61 this.validate(this._focused); 62 this.item=null; 60 63 }else{ 61 64 this._setValueFromItem(result[0], priorityChange); … … 95 98 // Sets the value of the select. 96 99 // Also sets the label to the corresponding value by reverse lookup. 100 this._lastQuery=value; 101 102 if(!value){ 103 this.setDisplayedValue("",priorityChange); 104 return; 105 } 97 106 98 107 //#3347: fetchItemByIdentity if no keyAttr specified … … 179 188 onError: function(errText){ 180 189 console.error('dijit.form.FilteringSelect: ' + errText); 181 dojo.hitch(_this, "_setValue")( undefined, label, false);190 dojo.hitch(_this, "_setValue")("", label, false); 182 191 } 183 192 }); -
dijit/trunk/tests/form/test_FilteringSelect.html
r13944 r13989 69 69 70 70 <form action="#" method="GET"> 71 <p>FilteringSelect #1: inlined data, autoComplete=false :</p>71 <p>FilteringSelect #1: inlined data, autoComplete=false, required="false":</p> 72 72 <label for="setvaluetest2">state list 1:</label> 73 73 <select dojoType="dijit.form.FilteringSelect" … … 79 79 onFocus="console.log('user focus handler')" 80 80 onBlur="console.log('user blur handler')" 81 >82 <option value="blank"></option>81 required="false" 82 > 83 83 <option value="AL">Alabama</option> 84 84 <option value="AK">Alaska</option>