« Back to Product

Documentation

Select

Creates a drop-down menu with the heading caption.
If created in the "elements" area, the drop-down menu sets a property to the selected value value when accepted.
The parameter "name" defines which property is set.

Warning

With MultiSelect it is important to ensure that all value arrays contain the same names

Warning

If Select is used within lists, there is no MultiSelect.

Example

Parameter

Parameter Description
caption Visible caption of the drop-down menu
download (optional) (default: "") If this parameter is not an empty string and the output of the onChange script is a Data-URL, the output is downloaded as a text file with the name of the download parameter. (since Symcon 7.0)
enabled (optional) (default: true) If true, the drop-down menu can be used, otherwise it is displayed as deactivated (since Symcon 5.2)
link (optional) (default: false) If this parameter is true, the output of the onChange script is opened as a link. If it is false, the output is displayed as a dialog in the configuration form. (since Symcon 6.0)
name (optional) Name of the drop-down menu/the property to be set
options Array containing all options
onChange (optional) (default: "") Script which is executed when the dropdown value is changed. If the script consists of several lines, the individual lines can also be defined as an array (arrays are supported from version 6.0). It has the same properties as onClick of the Button. (since Symcon 5.2)
type Select
value (optional) (default: first defined option) The value of the drop-down menu - If there is an associated property, this parameter is overwritten by the property in the elements area (since Symcon 5.2)
visible (optional) (default: true) If true, the drop-down menu is visible, otherwise it is invisible (since Symcon 5.2)
width (optional) (default: 300px) Fixed width of the input field in pixels or % as a string, e.g. "40%" or "250px" (since Symcon 5.3)

Parameters for options

Parameter Description
caption Caption of an option
enabled (optional) (default: true) If true, the option is active and can be selected, otherwise it is shown as inactive and cannot be selected (since Symcon 9.1)
label Caption of an option (deprecated)
value Value that is transferred when selected. Can also contain another array, which transfers the values to several properties.

Example

//Simple value transfer
//The "DeviceType" property is set to 0..3
//The drop-down menu has 4 entries
{ "type": "Select", "name": "DeviceType", "caption": "Unit",
    "options": [
        { "caption": "Bit (1Bit)", "value": 0 },
        { "caption": "Bits (2Bit)", "value": 1 },
        { "caption": "Bits (4Bit)", "value": 2 },
        { "caption": "Byte (8Bit)", "value": 3 }
    ]
}

//Multiple value transfer (MultiSelect)
//"name" of the Select (here: "OutputDevice") must be set, but is not used to set the values.
//Properties "DeviceName", "DeviceChannels" and "DeviceNum" are set.
{ "type": "Select", "name": "OutputDevice", "caption": "Output device",
    "options": [
        {"caption" : "No sound",
            "value": [
                {"name": "DeviceName", "value": "No sound"},
                {"name": "DeviceChannels", "value": 0},
                {"name": "DeviceNum", "value": 0}
            ]
        },
        {"caption" : "Headphones",
            "value": [
                {"name": "DeviceName", "value": "Headphones"},
                {"name": "DeviceChannels", "value": 2},
                {"name": "DeviceNum", "value": 1}
            ]
        },
        {"caption" : "Speaker",
            "value": [
                {"name": "DeviceName", "value": "Stereo speakers"},
                {"name": "DeviceChannels", "value": 2},
                {"name": "DeviceNum", "value": 2}
            ]
        }
    ]
}
Any questions?