Action

ActionIcon Description

Action nodes are used to create elements the user can click on the resulting web panel to obtain different results. The effect of clicking a particular action is fully customizable by the developer (by coding a specific GeneXus subroutine).

The appearance of an action on the generated web panel varies a lot depending on where the action is located. Real examples of actions can be found in the section "Runtime Appearance".

Basically, there are three main classes of actions:

  1. In-grid actions. This can be achieved by placing the action node inside a Grid Columns node.
  2. Standalone actions. This can be achieved by placing the action node inside an Actions node.
  3. Combobox actions. This can be achieved by placing the action node inside an Action groups node.

For each of these classes, almost all properties remain the same, with the exception of some of the properties referring to the runtime appearance of the action. Depending of the action's class, some properties (or properties' values) may be unavailable.

Runtime appearance

Below some examples of actions are shown, belonging to all three classes mentioned above. For standalone actions, three examples are included, to inlustrate the effects of modifying the "Type" property (explained in the "Properties" section).

ActionRuntimeInGrid ActionRuntimeStandalone ActionRuntimeStandaloneImage ActionRuntimeStandaloneButton
In-grid action Standalone text action Standalone image action Standalone button action

ActionRuntimeCombobox
Combobox action

Properties

Important: When used as a direct child of a LayoutContent node, the appearance of the action is inherited from the dynamic layout object used. Because of that, some properties are read only, and others are not shown. Those are the properties are related to the action's UI.

Category Name Value
General Action Name (Id) The action's Id. Must be unique inside the web panel. This property's value will be used when naming events and subroutines generated by this action. It is also used as the control name for the action.
Type

Indicates how the action should be rendered in the screen. Available options are:

  • Button: Will render the action as a GeneXus button control. Note: Only available for standalone actions.
  • Text: Will render the action as a text block with an associated On Click Event (The resulting appearance is similar to a link).
  • Image: Will render the action as an image, which can be chosen via the "Image" property. Note: Not available in Combobox actions
Caption The text that should be displayed on screen. This property is only used when the action's Type property is set to "Button" or "Text".
Event Type Indicates if the action's event should be an custom event created for it, or if it should be associated with the "Enter" event of the web panel.
Tooltip The tooltip text to be assigned to the action's control. Note: Not applicable for Combobox actions.
Alternate Text Alternate Text that should be associated to the image (only applicable when the Image property is set to a value different from "(none)").
Condition Should contain a condition which will determine in runtime if the action should appear as disabled or not.
Disable Type

Indicates which action to perform when disabling an action. Available options are:

Disable: The action's associated control will continue to be shown on the screen, but it will altered visually to indicate that the action is not available.
Hide: The action's associated control will not be visible when disabled.

Note: In combobox actions, this property is not available. When a combobox action is disabled, it disappears from the combobox.

No Skip

When set to true, the action will be shown in the same line as the last one. See NoSkip property.

Important: This property existed until K2BTools 13.2. In K2BTools 14.0 it was replaced by the "Element Relative Position" property.

Element Relative Position

Allows to configure the position of the element relative to the previous element. The possible values are:

  • New row
  • Same cell
  • New cell

For more information read Element Relative Position property

Note: Only present in Actions inside an Attributes node node.

Image The image to be shown when rendering this action. Only valid if action's Type property value is "Image".
Disable Image The image to be shown when rendering this action when it is disabled. Only valid if action's Type property value is "Image".
Image Column Width The width for the column that contains the Action. Only available if the action's Type property is set to "Image" and the action is included as a column in a Grid node.
Position *

Determines on which side of the screen the action will be shown.

When associated with a grid, this property's possible values depend on the Basic Layout object used in the web panel. See Using the Position property in actions for more information. Not available when the action is inside a ComboAction.

When not associated with a grid, possible values are:

  • Right
  • Left

Warning: The "Position" property was named "Layout" in K2BTools 11.1 and prior versions.

Move to overflow menu

Determines if the action should be shown in an overflow menu. Currently available only in actions with Position = InGrid.

Possible values are:

  • Never: Action is never moved to the overflow menu. This is the default.

  • In Extra Small: Action is moved to the overflow menu in the ExtraSmall screen size.

  • In Small and lower: Action is moved to the overflow menu in the ExtraSmall and Small screen sizes.

  • In Medium and lower: Action is moved to the overflow menu in the ExtraSmall, Small, and Medium screen size.

  • Always: Action is always shown in the overflow menu.

Security Entity Name The name of the entity which will be used to check authorization when entering the web panel. See K2BTools Security Model
Transaction Name The name of the transaction which will be used to check authorization when entering the web panel. See K2BTools Security Model
Standard Activity Type If applicable, the activity type which will be used to check authorization when entering the web panel (standard activity types only). See K2BTools Security Model
User Activity If applicable, the activity type which will be used to check authorization when entering the web panel (user activity types only). See K2BTools Security Model
Appearance Class The theme class that should be attached to the action's control.
Confirm Confirm Indicates if the user should be prompted for confirmation before executing the action's code. See Confirm property in actions
Confirm Message Expression The message to be displayed to the user when asking for confirmation.Must be between quotes. See Confirm property in actions
Generate Confirm No Subroutine Set to true, WPD will generate a user subroutine for the confirm cancel event. Confirm property in actions
MultiRow Row Selection

Indicates if the action should receive information about the selected items in the grid it belongs to. Possible values are:

  • None: If the action should not receive any information about the selected rows in the grid.
  • Single: If the action should receive which row is selected, and is designed to receive one row only.
  • Multiple: If the action should receive which rows are selected, and can handle multiple selections at once.

For more information on how this property should be used, see Row selection in actions

Note: This property is only available in action nodes inside a Grid node node but not inside columns (outside the actual grid).

Row Selection Scope Determines if the action will be executed for all selected rows or only to the selected rows that are visible in the grid.
Error No Select Line Message When executing this action, if the "Row Selection" property is set to "Single" or "Multiple" and no items from the grid are selected, an error message will be shown, with the message defined in this property.
Error Select Mode Than One Line Message When executing this action, if the "Row Selection" property is set to "Single" and more than one item from the grid are selected, an error message will be shown, with the message defined in this property.
Prompt Return On Click Used when the web panel being built is a prompt implementation. Indicates that after the action's code the prompt should return to its caller.
Responsive Design Show In Extra Small Determines if the action will be visible when using a device with a screen with a Extra Small size. See Introduction to Responsive Web Design.
Show In Small Determines if the action will be visible when using a device with a screen with a Small size. See Introduction to Responsive Web Design.
Show In Medium Determines if the action will be visible when using a device with a screen with a Medium size. See Introduction to Responsive Web Design.
Show In Large Determines if the action will be visible when using a device with a screen with a Large size. See Introduction to Responsive Web Design.
Grid Show Action Only If Available Determines if the action will be visible always or only when available according to the grid's selection and the Row Selection property. See Using the "Show Action Only If Available" option

User subroutines associated to this node

In the following table, <ActionId> should be replaced with the value of the "Action Name (Id)" property.

Name Moment of execution Detailed description and possible uses
U_<ActionId> On action execution

This subroutine is executed once every time the user clicks on the control associated with the action. The developer should place here the code needed to fullfill the action's purpose.

Note: In actions where the user is asked to confirm the action, this action will be executed only after the system has received confirmation from the user.

U_ConfirmationRequired(<ActionId>) Before action execution

This subroutine is generated only when the action requires confirmation from the user. It is executed before executing the "U_<ActionId>" subroutine, that is, before executing the actual action.

It should be used by the developer to determine if this action should be confirmed by the user or not. For example, in a billing system the developer can determine, using this subroutine, that all invoices with a total greater than a certain amount should be confirmed.

For more information about how to implement this subroutine, see Confirm property in actions.

Child nodes

This type of node can't hold any other nodes as children.