Skip to content

Dropdowns with Children

Erin Heinz edited this page Mar 16, 2020 · 1 revision

This control allows the user to select an option from the dropdown and have additional related form fields appear beneath the dropdown.

*= required property

Property Value Use Example
type -- Type is not used here. Instead this control looks for the oneOf key and an array of objects. --
*display "dropdown" OR "radio-buttons" Used to determine how to do display the enum choice. Note: Only dropdowns are currently supported. Future display options, such as radio buttons and tabs, may be supported in the future. "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": "Too tip for the form element."
*oneOf Object[] See Sections The names of each of these objects will be used to create a dropdown to choose from. The corresponding children form elements will be displayed for the selected object. Note: since this is an array of objects, the object’s key must be explicitly added. See example below.
required String[] This property is added to the object to indicate which children are required. Used in the child objects of the oneOf array. It is an array of keys associated with a child control. These keys can only be keys that exist in this section’s properties object. This array cannot reference nested keys. "required": ["key1", "key2"]
default String This is the key of the selected option The key of the default object 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 and all of its children from view of the user. However, this can still be programmatically set. "isHidden": true

Example

 "employeeIDFieldInBamboo": {
    "name": "Store TriNet Employee ID in BambooHR as:",
    "display": "dropdown",
    "default": "employeeNumber",
    "oneOf": [
      {
        "type": "object",
        "name": "Employee Number",
        "key": "employeeNumber",
        "properties": {
        }
      },
      {
        "type": "object",
        "name": "TriNet Employee ID",
        "key": "triNetEmployeeId",
        "required": [
          "employeeId"
        ],
        "properties": {
          "employeeId": {
            "type": "string",
            "name": "Employee ID"
          }
        }
      }
    ]
  }

Example Return Value

"employeeIDFieldInBamboo": {
    "triNetEmployeeId": {
         "employeeId": "employeeId123"
    }
}

2.0.0

  • Enhancement: Added the ability to make a control readonly
  • Enhancement: Added the ability to hide a form control
  • Enhancement: Added the basic dropdown with children functionality
Clone this wiki locally