Opened 15 years ago

Closed 15 years ago

#1504 closed defect (fixed)

ComboBox/Select - manually setting values not working with forceValidOption set

Reported by: [email protected] Owned by: Douglas Hays
Priority: high Milestone: 0.9
Component: Widgets Version: 0.3
Keywords: ComboBox, Select Cc:
Blocked By: Blocking:


Manually setting selected value is not working when forceValidOption is set. This is default behavior for the Select widget. Problem is in _isValidOption method. Value should be checked against the data array and not the list node items. Btw, first two rows of the method are repeated (typo).

Change History (7)

comment:1 Changed 15 years ago by [email protected]

Works only when the list is generated from an existing options list of the select form element. List node is not populated when using remote data provider.

comment:2 Changed 15 years ago by [email protected]

Something like this:

_isValidOption: function(){

var isValidOption = false; for(var i = 0; i <; i++)


isValidOption = true; break;


return isValidOption;


comment:3 Changed 15 years ago by dylan


comment:4 Changed 15 years ago by bill


Unfortunately this is going to require a protocol change. We've talked about this in other bug reports. Basically the sensible API is something like (for example):


which will set the (hidden) value to "CA" and the (displayed) label to "California". But that requires an API to the dataprovider to map from value to label. And in the case of incrementalDataProvider, that in turn requires a protocol from the client to the server.

Bumping to 0.5 for now.

comment:5 Changed 15 years ago by Douglas Hays

Owner: changed from bill to Douglas Hays

comment:6 Changed 15 years ago by [email protected]

I fixed it on my version, will commit once is sorted out.

When you type in California into any of the Select widgets in the test and press Enter or blur focus, the text remains and the value changes to CA.

comment:7 Changed 15 years ago by Douglas Hays

Resolution: fixed
Status: newclosed

(In [8352]) Port of ComboBox?(=AutoCompleter?) and Select widgets to 0.9 dojo by [email protected]…. Fixes #2189, #1504, #1451, #2244, #2384, #2070, #899, #912, #1267, #1339, #1456, #1484, #1485, #2558, #1186

Note: See TracTickets for help on using tickets.