Control form - Actions tab
Action sets determine the behavior of a control.
An action set is a combination of an event and an action configured for a control. An event triggers an action. For example, a mouse click refreshes a section. For each action set, you must define at least one event and one action. You can define multiple events and actions for a single action set. You can create multiple actions sets for a single control. You can also specify a condition for the action set.
Action sets consist of the following elements:
- Event - Something that a user does, such as click, double-click, hover, focus, keyboard entry, and so on.
- Action - A response that the system performs as a result of the user event. For example, when the user clicks a button, a case is created.
- Conditions - Optionally, you can specify restrictions, such as When
conditions, that can be applied to an event and action combination. For example, you can
configure conditions so that hovering over a field displays a tooltip only if the field
contains a property value.
Using When conditions, you can combine behaviors for a single control. For example, a first behavior states that when the user focuses on the Input Area, the system sets the background color to red (defined in the Inline Style field) if the area is populated. A second behavior states that, for the same event, the system sets the background color to blue if the area is empty.
Note: Buttons do not use behavior conditions. Use the Disabled or Privilege fields in the Options area to determine whether the button is available to specific users. You cannot use conditions with Action control types-use the Disabled, Privilege, or both settings in the Options area.
Actions execute from the top down, in the order in which they are listed. The inherited actions (the ones in the rule) execute first. All processing effects of an action in the list will complete before the next action starts. Use the row handles to rearrange the action sets if necessary.
Display > Set Valueaction is followed by a
Launch > Local Actionaction. When the user clicks the button, the
Set Valueaction also triggers a
Post Valueaction (set in the Behavior field on the Cell Properties panel) and recalculation of an expression. After all processing is completed, the system starts the
Action sets contain settings to specify the behavior of the control in Read-write and Read-only modes.
The UI Gallery landing page contains working examples of many controls. For more information, see UI Gallery landing page.
Defining behaviors in the Parameters dialog box
When customizing a control in the Parameters tab, you can add but cannot delete or modify behaviors defined in the underlying rule. The rule's behavior appear in a top grid. A bottom grid enables you to add conditions, which you can delete or modify.
Adding actions to custom controls
Custom non-autogenerated controls support the same actions and event types that are available in standard autogenerated controls, which means you can add multiple action sets for different types of events on a custom control. You can use the legacy or standard action type on custom controls and you can add multiple action sets for different types of events on a custom control.
- If an existing non-autogenerated control has actions configured, the legacy action type is selected by default.
- For new custom controls or existing custom controls with no actions only the standard action configuration is shown in the Actions tab.
To generate the required actions markup for non-autogenerated controls include this JSP in the non-autogenerated control HTML:
<pega:include type="fragment" name="pzActionSetAttributes"/>
- Creating an action set
Define an action set to specify what a control does when a user event happens.
- Available actions and conditions
Choose an action from the list, see which options are available for the action and when you can use it. Learn which conditions you can apply.
Previous topic Control form - Completing the Pages and Classes tab Next topic Creating an action set