ui.Dialog.setActionActive()

The SetActionActive() method is used to enable/disable actions specified in ACTION or COMMAND clauses. The method has the following reference syntax:

 

DIALOG.SetActionActive(action, boolean)

 

The action argument is a string (lower case is a must) which defines the action influenced by the method. The action can be identified fully or partially. If the last is the case, the missing information is automatically filled depending on the context:

 

The dialog_name is a string containg the name of a singular dialog or a sub-dialog. The filed_name is a string identifying the field used in an INFIELD clause of an ON ACTION block.

 

If the method does not find the action specified in the action argument a run-time error will occur. If the SetActionActive() method is used within a sub-dialog, the identifier of this sub-dialog can be omitted.

 

In a singular interaction statements like INPUT, the field-specific actions can be referenced by field_name.action_name structure if the dialog definition did not contain the NAME attribute.

 

The Boolean attribute specifies whether the action can be invoked. The attribute should be represented as 1 (TRUE, the action is enabled) or 0 (FALSE, the action is disabled). In GUI mode, the form elements, such as buttons, become inactive when the actions bound to them are disabled.

 

You can use the SetActionActive() method in an INFIELD block in order to disable or enable an action when a cursor goes to a specified field. In order to simplify the actions management, you can create a separate function which analyses the context and activates/deactivates the actions available on the current stage.