Copy link to clipboard
Copied
If the event.value of a combo box is the item name of the current selection, then what do you use to reference the current selection's export value?
Good question. There's no simple way. The most direct way would be to use the currentValueIndices property and the getItemAt method to get it, but that doesn't update until after the validation event, so if you try it you'll get the value from before the change.
The only approach that I found to work is to basically iterate over all the items in the field (using numItems and getItemAt), comparing them to event.value, and if you find a match then use getItemAt again to get the export value of that
...Copy link to clipboard
Copied
Good question. There's no simple way. The most direct way would be to use the currentValueIndices property and the getItemAt method to get it, but that doesn't update until after the validation event, so if you try it you'll get the value from before the change.
The only approach that I found to work is to basically iterate over all the items in the field (using numItems and getItemAt), comparing them to event.value, and if you find a match then use getItemAt again to get the export value of that index.
Copy link to clipboard
Copied
I guess I won't worry about it, then; referencing the item name works fine; it just seemed a little clunky. Thanks.