Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
JavaScript Suite Documentation
ChoiceSet

ChoiceSet Class Reference

Constructors

Instance Methods

Constructors

new ChoiceSet(title, choices, listener)

Create a new instance of ChoiceSet Initialize with a title, choices, and listener. It will use the default timeout and layout, all other properties (such as prompts) will be null. WARNING: If you display multiple cells with the same title with the only uniquing property between cells being different `vrCommands` or a feature that is not displayed on the head unit (e.g. if the head unit doesn't display `secondaryArtwork` and that's the only uniquing property between two cells) then the cells may appear to be the same to the user in `Manual` mode. This only applies to RPC connections >= 7.1.0. WARNING: On < 7.1.0 connections, the title cell will be automatically modified among cells that have the same title when they are preloaded, so they will always appear differently on-screen when they are displayed. Unique text will be created by appending " (2)", " (3)", etc.

Instance Methods

choiceSet.cancel()

Cancels the choice set. If the choice set has not yet been sent to Core, it will not be sent. If the choice set is already presented on Core, the choice set will be immediately dismissed. Canceling an already presented choice set will only work if connected to Core versions 6.0+. On older versions of Core, the choice set will not be dismissed.

Kind: Instance method of ChoiceSet

choiceSet.getCanceledListener() ⇒ function

Get the state canceledListener

Kind: Instance method of ChoiceSet
Returns: function - The canceledListener

choiceSet.getChoiceSetSelectionListener() ⇒ ChoiceSetSelectionListener

Get the state choiceSetSelectionListener

Kind: Instance method of ChoiceSet
Returns: ChoiceSetSelectionListener - The choiceSetSelectionListener

choiceSet.getChoices() ⇒ Array.<ChoiceCell>

Get the state choices

Kind: Instance method of ChoiceSet
Returns: Array.<ChoiceCell> - The choices

choiceSet.getCustomKeyboardConfiguration() ⇒ KeyboardProperties

Get the state customKeyboardConfiguration

Kind: Instance method of ChoiceSet
Returns: KeyboardProperties - The customKeyboardConfiguration

choiceSet.getDefaultTimeout() ⇒ Number

Get the state default timeout

Kind: Instance method of ChoiceSet
Returns: Number - The default timeout

choiceSet.getHelpPrompt() ⇒ [Array.<TTSChunk>, null]

Get the state helpPrompt

Kind: Instance method of ChoiceSet
Returns: [Array.<TTSChunk>, null] - The helpPrompt

choiceSet.getInitialPrompt() ⇒ [Array.<TTSChunk>, null]

Get the state initialPrompt

Kind: Instance method of ChoiceSet
Returns: [Array.<TTSChunk>, null] - The initialPrompt

choiceSet.getLayout() ⇒ ChoiceSetLayout

Get the state layout

Kind: Instance method of ChoiceSet
Returns: ChoiceSetLayout - The layout

choiceSet.getTimeout() ⇒ Number

Get the state timeout

Kind: Instance method of ChoiceSet
Returns: Number - The timeout of a touch interaction in seconds (Manual/touch only)

choiceSet.getTimeoutPrompt() ⇒ [Array.<TTSChunk>, null]

Get the state timeoutPrompt

Kind: Instance method of ChoiceSet
Returns: [Array.<TTSChunk>, null] - The timeoutPrompt

choiceSet.getTitle() ⇒ String

Get the state title

Kind: Instance method of ChoiceSet
Returns: String - The title

choiceSet.getVrHelpList() ⇒ [Array.<VrHelpItem>, null]

Get the state vrHelpList

Kind: Instance method of ChoiceSet
Returns: [Array.<VrHelpItem>, null] - The vrHelpList

choiceSet.setCanceledListener(canceledListener) ⇒ ChoiceSet

Set the state canceledListener Cancels the choice set. If the choice set has not yet been sent to Core, it will not be sent. If the choice set is already presented on Core, the choice set will be immediately dismissed. Canceling an already presented choice set will only work if connected to Core versions 6.0+. On older versions of Core, the choice set will not be dismissed.

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
canceledListener function The canceledListener

choiceSet.setChoiceSetSelectionListener(choiceSetSelectionListener) ⇒ ChoiceSet

Set the state choiceSetSelectionListener The listener of this choice set, called when the user interacts with it

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
choiceSetSelectionListener ChoiceSetSelectionListener The choiceSetSelectionListener

choiceSet.setChoices(choices) ⇒ ChoiceSet

Set the state choices The choices to be displayed to the user within this choice set. These choices could match those already preloaded This is limited to 100 items. If you attempt to set more than 100 items, the set will not have any items (this array will be empty).

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
choices Array.<ChoiceCell> The choices

choiceSet.setCustomKeyboardConfiguration(customKeyboardConfiguration) ⇒ ChoiceSet

Set the state customKeyboardConfiguration Implement this in order to provide a custom keyboard configuration to just this keyboard. To apply default settings to all keyboards, see ScreenManager.setKeyboardConfiguration

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
customKeyboardConfiguration KeyboardProperties The customKeyboardConfiguration

choiceSet.setDefaultTimeout(defaultTimeout) ⇒ ChoiceSet

Set the state default timeout Set this to change the default timeout for all choice sets. If a timeout is not set on an individual choice set object (or if it is set to 0.0), then it will use this timeout instead. See `timeout` for more details. If this is not set by you, it will default to 10 seconds. The minimum is 5 seconds, the maximum is 100 seconds. If this is set below the minimum, it will be capped at 5 seconds. If this is set above the maximum, it will be capped at 100 seconds.

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
defaultTimeout Number The default timeout

choiceSet.setHelpPrompt(helpPrompt) ⇒ ChoiceSet

Set the state helpPrompt Maps to PerformInteraction.helpPrompt. This is the spoken string when a user speaks "help" when the interaction is occurring.

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
helpPrompt Array.<TTSChunk> The helpPrompt

choiceSet.setInitialPrompt(initialPrompt) ⇒ ChoiceSet

Set the state initialPrompt Maps to PerformInteraction.initialPrompt. The initial prompt spoken to the user at the start of an interaction.

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
initialPrompt Array.<TTSChunk> The initialPrompt

choiceSet.setLayout(layout) ⇒ ChoiceSet

Set the state layout Maps to PerformInteraction.interactionLayout. Whether the presented choices are arranged as

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
layout ChoiceSetLayout The layout

choiceSet.setTimeout(timeout) ⇒ ChoiceSet

Set the state timeout Maps to PerformInteraction.timeout. Timeout in seconds. Defaults to 0, which will use `defaultTimeout`. If this is set below the minimum, it will be capped at 5 seconds. Minimum 5 seconds, maximum 100 seconds. If this is set above the maximum, it will be capped at 100 seconds. Defaults to 0. This applies only to a manual selection (not a voice selection, which has its timeout handled by the system).

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
timeout Number The timeout of a touch interaction in seconds (Manual/touch only)

choiceSet.setTimeoutPrompt(timeoutPrompt) ⇒ ChoiceSet

Set the state timeoutPrompt Maps to PerformInteraction.timeoutPrompt. This text is spoken when a VR interaction times out. If this set is presented in a manual (non-voice) only interaction, this will be ignored.

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
timeoutPrompt Array.<TTSChunk> The timeoutPrompt

choiceSet.setTitle(title) ⇒ ChoiceSet

Set the state title Maps to PerformInteraction.initialText. The title of the choice set, and/or the initial text on a keyboard prompt.

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
title String The title

choiceSet.setVrHelpList(vrHelpList) ⇒ ChoiceSet

Set the state vrHelpList Maps to PerformInteraction.vrHelp. This is a list of help text presented to the user when they are in a voice recognition interaction from your choice set of options. If this set is presented in a touch only interaction, this will be ignored. Note: That while VRHelpItem's position will be automatically set based on position in the array, the image will need to uploaded by you before use using the FileManager.

Kind: Instance method of ChoiceSet
Returns: ChoiceSet - A reference to this instance to support method chaining

ParamTypeDescription
vrHelpList Array.<VrHelpItem> The vrHelpList
View on GitHub.com
Previous Section Next Section