Skip to content

Dropdowns & Radio Buttons

mdoyle023 edited this page Apr 13, 2021 · 2 revisions

Radio Button & Dropdown Shared Properties

*required property

Property Value Use Example
type -- Type is not used here. Instead, this control looks for the enum key and an array of strings. --
*display dropdown OR radio-buttons Used to determine how to do display the enum choice. "display": "dropdown" OR "display": "radio-buttons"
*name String The corresponding label for the form element "name": "Form Display Name"
helpText String Will display as an information icon next to the form element. The provided string will display when the user hovers over the icon. "helpText": "This is help text that can be very long."
tooltip String The tooltip that will display when hovering over the form element "tooltip": "Tool tip for the form element."
*enum String[] OR Integer[] Available options for the form control. Objects are not currently supported. "enum": ["option1", "option2"]
enumNames String[] Corresponding option names for enum that will appear to the user. Name index corresponds to enum index. Missing names are generated from the enum options by converting from camelCase to Title Case. "enum": ["option1", "option2"]
default String The default value that should be in the input. "default": "option1"
isReadOnly boolean This property indicates that the input control cannot be changed by the user. Any data within a readonly field will not be returned upon form submission. "isReadOnly": true
isHidden boolean This flag will hide the element from the view of the user. However, this can still be programmatically set. "isHidden": true

Radio Button Format

Radio buttons will always be required. If no value is passed in, the first value will be selected by default.

Example

"theme": {
    "display": "radio-buttons",
    "name": "Color Theme",
    "enum": [
    	"blueIce",
    	"greyDay",
    	"superGreen"
    ],
	"enumNames": [
		"Blue Ice",
		"Grey Day",
		"Super Green"
	]
}

Dropdown Format

Dropdowns will always be required.

Example

"theme": {
    "display": "dropdown"
    "name": "Color Theme",
    "enum": [
    	"blueIce",
    	"greyDay",
    	"superGreen"
    ],
	"enumNames": [
		"Blue Ice",
		"Grey Day",
		"Super Green"
	]
}

3.0.0

  • Breaking Change: Enums are always required regardless of display type

2.0.0

  • Enhancement: Added the ability to make a control readonly
  • Enhancement: Added the ability to hide a form control
  • Breaking Change: Modified enum property to match JSON schema spec, currently excluding support of objects. Added enumNames array to provide names for option display.
  • Enhancement: Added the basic dropdown and radio button functionality