Ticket #1504 (closed defect: fixed)

Opened 2 years ago

Last modified 19 months ago

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

Reported by: acirov@… Owned by: doughays
Priority: high Milestone: 0.9
Component: Widgets Version: 0.3
Severity: major Keywords: ComboBox, Select
Cc:

Description

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

Changed 2 years ago by acirov@…

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.

Changed 2 years ago by acirov@…

Something like this:

_isValidOption: function(){

var isValidOption = false; for(var i = 0; i < this.dataProvider.data.length; i++)

if(this._isInputEqualToResult(this.dataProvider.data[i][0])){

isValidOption = true; break;

};

return isValidOption;

}

Changed 2 years ago by dylan

  • milestone changed from 0.4 to 0.4.1

Changed 2 years ago by bill

  • milestone changed from 0.4.1 to 0.5

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):

   mySelectWidget.setValue("CA");

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.

Changed 22 months ago by doughays

  • owner changed from bill to doughays

Changed 20 months ago by haysmark@…

I fixed it on my version, will commit once dojo.data 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.

Changed 19 months ago by doughays

  • status changed from new to closed
  • resolution set to fixed

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

Note: See TracTickets for help on using tickets.