LinkedIn
Copied!

Checkbox control in DX API

The Checkbox control (pxCheckbox) present a user with an option or a list of options, from which the user can make a single selection. Learn about the JSON structure and elements of a sample Checkbox control, to understand how you can integrate it into your custom application.

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

{
    "validationMessages": "",
    "visible": true,
    "labelReserveSpace": true,
    "readOnly": false,
    "control": {
        "modes": [
            {
                "captionPosition": "right",
                "modeType": "editable",
                "controlFormat": "Standard",
                "textAlign": "Left",
                "tooltip": "checkbox hover",
                "maxChars": "",
                "formatType": "text",
                "specifySize": "auto",
                "obfuscated": false,
                "minChars": ""
            },
            {
                "trueLabel": "True",
                "modeType": "readOnly",
                "falseLabel": "False",
                "falseImage": "",
                "showValueAs": "text",
                "tooltip": "",
                "showReadOnlyValidation": "true",
                "formatType": "truefalse",
                "obfuscated": false,
                "trueImage": ""
            }
        ],
        "actionSets": [
            {
                "actions": [
                    {
                        "action": "refresh",
                        "refreshFor": "VGVzdA%3D%3D"
                    }
                ],
                "events": [
                    {
                        "event": "change"
                    }
                ]
            },
            {
                "actions": [
                    {
                        "action": "refresh",
                        "refreshFor": "VGVzdA%3D%3D"
                    },
                    {
                        "action": "postValue"
                    }
                ],
                "events": [
                    {
                        "event": "focus"
                    },
                    {
                        "event": "click"
                    }
                ]
            }
        ],
        "label": "checkbox caption",
        "type": "pxCheckbox"
    },
    "label": "Checkbox",
    "type": "True-False",
    "showLabel": true,
    "required": false,
    "validateAs": "",
    "reference": "cbprop",
    "labelFormat": "Standard",
    "disabled": false,
    "testID": "20200730015740046596",
    "value": "true",
    "maxLength": 0,
    "expectedLength": "",
    "fieldID": "cbprop",
    "customAttributes": {
        "testAttr": "testVal"
    }
}

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 Visibility or Disable, return boolean values.
  • Fields, such as Helper text or Default value, return the corresponding value from the associated Pega rules.
  • For conditions, such as Visibility or Disable, only the Always and Condition (when rule) options are supported.
  • For conditions, such as Visibility or Disable, for the Condition (when rule) option, negation with the logical operator (!) is supported. For example, !pzVisibleWhen.
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 response returns the value of the Edit options field as a boolean readOnly element. The read-only value is part of 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?

Have a question? Get answers now.

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