The role of Actions in Smart Device objects is to provide interaction between the application and the final user, in any of these ways:
- With a server side process (web service).
For instance, in the case of an Action that calls a procedure to authorize an Order, an online app will generate that procedure on the server side, and will be invoked via web service rest.
- With a local process (soon to be available)
As in the previous example, when the app is generated offline, this procedure will be executed locally on the device.
For example: calling an Action to add a new Contact to the client contact list."
An action has a close relationship with Buttons and with the classical GeneXus Events. So what this relationship is?
||Is the concept (Authorize, Add to favorites, etc.).
||Visual aspects for the Action. How must be show the action on the User Interface.
So each Action has an associated Event and many properties related with their control information.
Actions can be defined for:
After you define an Action you can program its handler using an Event.
By default actions are included in default menus, but you can include them in the layouts, dragging them to some layout.
On iOS you can have a "destructive action" which wiil be shown in red, as follows:
In order to have an action like this in GeneXus we just need to name the event 'Delete'.
Destructive actions are available for iOS since GeneXus X Evolution 3 Upgrade 4.