UI Element Actions

Some UI elements such as the Button element can react to a user's interaction: clicking on the corresponding pushbutton can trigger a handling method to be called within the view controller. Such UI elements are equipped with one or several general events, which can be linked with a specific action at design time (switching to a subsequent view, for example). If such an action is created, an event handler method for this action is created automatically. In this way, you can equip a UI element event (which has been inserted several times into a view) with different actions as necessary. The event is then processed by the corresponding event handler depending on the action that is linked.

Action

For more information about frequently used actions, see Parameter Mapping.

Creating Actions

As is the case with data binding, actions of UI elements are created and maintained in the properties table of the View Editor.

Actions can transfer both mandatory and optional parameters.

If the value of the UI element is bound to a context element (e.g. RadioButton, CheckBox), and the value is changed, it is only transferred if an action is defined. Otherwise, the change is recorded on the client and transferred with the next roundtrip, and the context adjusted accordingly.

With UI elements that require no input, for example, Button or LinkToAction, an action can only occur if it has been defined. This can also be an empty event handler method.

Event Handler Methods

When you create a new action, the corresponding event handler method is created automatically. It is empty at first and the application developer can insert source code using the ABAP Editor. The event handler methods are - like all other methods of the view - part of the view controller. Therefore, they are listed in the table of the Methods tab in the View Editor.

Controller Methods

Event handler methods are special methods of a controller - in this case, of the view controller. From a technical point of view, they do not differ from other controller methods like the initial method WDDOINIT or the method WDDOEXIT. Due to a convention, however, their names have the prefix ONACTION followed by the action name specified by the application developer.

For information about programming event handler methods, see Action Event Handlers.