LinkedIn
Copied!

Table of Contents

Button control in DX API

The Button control (pxButton) helps users trigger actions in their applications. Learn about the JSON structure and elements of a sample Button control, to understand how you can integrate the element into your custom application.

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

{
   "view":{
      "reference":"",
      "validationMessages":"",
      "viewID":"GetInfo",
      "visible":true,
      "name":"Get info",
      "appliesTo":"OU1F1E-CodeNinjas-Work-NoCase",
      "groups":[
         {
            "layout":{
               "visible":true,
               "titleFormat":"h2",
               "containerFormat":"NOHEADER",
               "groups":[
                  {
                     "field":{
                        "validationMessages":"",
                        "visible":true,
                        "labelReserveSpace":true,
                        "readOnly":false,
                        "control":{
                           "modes":[
                              {
                                 "modeType":"ignore",
                                 "tooltip":""
                              },
                              {
                                 "modeType":"readOnly",
                                 "autoPrepend":"",
                                 "controlFormat":"Simple",
                                 "tooltip":"Add a condition",
                                 "showReadOnlyValidation":"false",
                                 "autoAppend":"",
                                 "formatType":"text"
                              }
                           ],
                           "actionSets":[

                           ],
                           "label":"Submit",
                           "type":"pxButton"
                        },
                        "label":"Button caption",
                        "type":"Text",
                        "showLabel":true,
                        "required":false,
                        "validateAs":"",
                        "reference":"pyTemplateButton",
                        "labelFormat":"Announcement",
                        "disabled":false,
                        "testID":"202008120745330125290",
                        "value":"",
                        "maxLength":0,
                        "expectedLength":"",
                        "fieldID":"pyTemplateButton",
                        "customAttributes":{
                           "AttributeName":"AttributeValue"
                        }
                     }
                  }
               ],
               "groupFormat":"Stacked",
               "layoutFormat":"SIMPLELAYOUT",
               "title":""
            }
         }
      ]
   },
   "caseID":"OU1F1E-CODENINJAS-WORK N-123002",
   "name":"Get info",
   "actionID":"GetInfo"
}

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

Cell properties - General tab
Cell properties - General tab
  • 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.
  • The JSON response does not contain the data for the Button caption, Image source, Class, and Image position fields.
Cell properties - General tab, continued
Cell properties - General tab, continued
The JSON response does not contain the data for the Privilege, When not met, and Tour ID fields.
Cell properties - Presentation tab
Cell properties - Presentation tab
  • The JSON response does not contain the data for the Set as Floating Action Button (FAB) check box.
  • For the Control format field, the value for the Standard option that is returned in the response is pzhc. The remaining options are returned as they are displayed in the UI. For example, the value for the Simple option remains Simple.
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.