OnSelect

Description

Specify JavaScript to execute when a value in the Spin List is selected.

Discussion

The OnSelect event executes whenever a value is selected in the Spin List control. This can happen when the user selects an item in the list, the .setValue() method is called, or when the variable bound to the control is changed in some other way. This event can be used to execute JavaScript to manipulate other controls in the UX Component or call a Javascript Action. The JavaScript can refer to the selected value using this.value. For example:

var value = this.value;
alert("The Spin List control's value has changed to " + value);

The OnSelect event is often used to create cascading Spin List controls. When the value in a parent Spin List control changes, the child Spin Lists must be updated. If the child control is based on a Data Series, JavaScript is added to the OnSelect event for the parent Spin List to update the Data Series, which will refresh the child control:

{dialog.object}.refreshDataSeries('seriesCities');

See Cascading Spin Lists to learn more.