Action attributes for non-autogenerated controls

Using the API to call events in a custom control requires markup that contains specific data- attributes to represent events and actions. When these data- attributes are used in a non-autogenerated control, the Pega 7 Platform routes actions and events through the same infrastructure as the autogenerated controls.

Action attributes follow a specific pattern where the data- is followed by the user's interaction. For example, data-esc-key describes an action triggered by pressing the ESC key and data-focus describes an action triggered by the control coming into focus. The data-ctl attribute is required since it identifies the control type. In the case of custom controls this should be set to data-ctl=”non-auto”.

In the example, the action is configured to do a setValue. The value of data-click is configured on the Actions tab of the control's property panel.

The data-ctl attribute is required to identify the control in the event infrastructure. For a custom control, the attribute is: data-ctl = 'non-auto'. The second element in the example represents the parameter values configured for the action.

Multiple event actions

If actions correspond to multiple events, the markup requires all the corresponding data- event attributes. For example, the onChange-postValue and onHover-showSmarTtip for a text input:

If the markup of your custom control generates these attributes, the Pega UI engine processes these actions by using the same event infrastructure as autogenerated controls. The engine handles the event sequencing and waits for the server response on the first action before processing the second action, if necessary.

Through this method, action markup can be generated in custom controls for all actions (those supported for autogenerated controls through configuration). To find the exact parameters for corresponding actions, configure the same action on an autogenerated control and view the markup through a browser's developer tools.

Supported data- control attributes

The following data- attributes are supported in autogenerated and custom non-autogenerated controls:

Have a question? Get answers now.

About Pegasystems

Pegasystems is the leader in cloud software for customer engagement and operational excellence. If you’ve driven a car, used a credit card, called a company for service, opened an account, flown on a plane, submitted a claim, or performed countless other everyday tasks, chances are you’ve interacted with Pega. For the past 30 years, our technology – CRM, digital process automation, robotics, AI, and more – has empowered the world’s leading companies to achieve breakthrough results.