LinkedIn
Copied!

Table of Contents

Radio buttons control in DX API

The Radio buttons control (pxRadioButtons) helps you display a horizontal or vertical list of options, from which a user can select a single option. Learn about the JSON structure and elements of a sample Radio buttons control, to understand how you can integrate the element into your custom application.

The following JSON code is a sample API response for the Radio buttons control:

{
    "validationMessages": "",
    "visible": true,
    "labelReserveSpace": true,
    "readOnly": false,
    "control": {
        "modes": [
            {
                "groupOrder": "asc",
                "orientation": "vertical",
                "clipboardPageValue": "StateAbbr",
                "listSource": "pageList",
                "textAlign": "Left",
                "wrapAfter": "3",
                "tooltip": "",
                "enableGrouping": false,
                "groupBy": "",
                "minChars": "",
                "clipboardPageTooltip": "StateFullName",
                "modeType": "editable",
                "clipboardPageID": "StateList",
                "clipboardPagePrompt": "StateName",
                "controlFormat": "",
                "loadMode": "auto",
                "options": [
                    {
                        "tooltip": "Commonwealth of Massachusetts",
                        "value": "Massachusetts",
                        "key": "MA"
                    },
                    {
                        "tooltip": "State of Rhode Island and Providence Plantations",
                        "value": "Rhode Island",
                        "key": "RI"
                    },
                    {
                        "tooltip": "New Hampshire",
                        "value": "New Hampshire",
                        "key": "NH"
                    }
                ],
                "maxChars": "",
                "placeholder": "sample RB",
                "formatType": "text",
                "specifySize": "auto",
                "obfuscated": false
            },
            {
                "modeType": "readOnly",
                "autoPrepend": "",
                "tooltip": "",
                "showReadOnlyValidation": "false",
                "autoAppend": "",
                "formatType": "text",
                "obfuscated": false
            }
        ],
        "actionSets": [],
        "type": "pxRadioButtons"
    },
    "label": "Radio Buttons",
    "type": "Text",
    "required": false,
    "validateAs": "",
    "reference": "pyTemplateRadioButton",
    "labelFormat": "Standard",
    "disabled": false,
    "testID": "2019082614265209413b8170e6-56db-4f4d-a7a2-825abcd1af2d84",
    "value": "",
    "maxLength": 0,
    "expectedLength": "",
    "fieldID": "pyTemplateRadioButton"
}

The following examples show a sample configuration of the control with the relevant JSON elements:

Cell properties - General tab
Cell properties - General tab
  • When rules that are part of conditions, such as VisibilityDisable, or Required, return boolean values.
  • For conditions, such as Visibility, Disable, or Required, for the Condition (when rule) option, negation with the logical operator (!) is supported. For example, !pzVisibleWhen.
  • Fields, such as Placeholder or Helper text, return the corresponding value from the associated Pega rules.
  • For conditions, such as VisibilityDisable, or Required, only the Always and Condition (when rule) options are supported.
Cell properties - General tab, continued
Cell properties - General tab, continued
  • The values in the Radio buttons control are represented by the control.modes[0].options: array element. 
  • For the Type field, the Report definition option is not supported.
  • If the list source is a data page, the response includes the following values:

    • dataPageID - The ID of the data page. To obtain the values for the list, call the GET/data/{datapageID} endpoint.
    • dataPageValue - The key of the value selected from the list of values in the data page.
    • dataPagePrompt - The visible label of the value selected from the list of values in the data page.
      See the following example of a data page as the list source:
      "control": { "modes": [{ "dataPagePrompt": "TeamName", "dataPageValue": "TeamName", "listSource": "datapage", "dataPageID": "D_GetTeams" }], "type": "pxRadioButtons" }
DX API attributes
DX API attributes
The response returns the name-value pairs that you add to the DX API attributes of the control as part of the customAttributes element.
Property referenced in the control - General tab
Property referenced in the control - General tab
Property referenced in the control - Advanced tab
Property referenced in the control - Advanced tab
The message in the validationMessages element is displayed when the validation in the validateAs element fails.
Cell properties - Presentation tab
Cell properties - Presentation tab
  • The Edit options field returns a boolean value.
  • The value of the Read-only value field is displayed in the value key in the JSON response.
Cell properties - Presentation tab, continued
Cell properties - Presentation tab, continued
Suggest Edit
Did you find this content helpful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.