What this will do, is allow the user to type in a value that is NOT in the dataprovider. If this happens, you get a selectedIndex of -3 and a valid selectedItem...
Here is your pitfall
if (comboBox.selectedIndex != -1) { myImportantValue = comboBox.selectedItem }You could end up with non-valid user inputed values here.... the better solution is.
if (comboBox.selectedIndex >=0) { myImportantValue = comboBox.selectedItem }
No comments:
Post a Comment