Specifies whether an item, page, or form is currently activated by the user or not. This option is usually set by an external program such as a parser, but under certain circumstances can be set by computes in the form.
The activated option for an item can be set by a compute if the item is an action, button or cell utilized on the current page. The activated option must be set to either on or off and the item must be capable of being activated. Cells that are not grouped with a popup, combobox or list on the current page cannot be activated. Buttons that are not visible cannot be activated.
This option is not saved or transmitted as part of the form. Instead, it is automatically created each time the form is read into memory, and is maintained only during display or processing.
<activated>status</activated>
Parameter | Type | Description |
---|---|---|
status | on | item, page, or form is currently activated by user |
off | item, page, or form is not currently activated by user | |
maybe | button only: item might be activated, as user has pressed it, but has not yet released it |
action, button, cell, combobox, popup, page global, form global
The following example shows a button that changes color when it is activated:
<button sid="saveButton">
<type>saveas</type>
<value>Save</value>
<activated>off</activated>
<bgcolor compute="toggle(activated, 'off', 'on') == '1'
? 'white' : 'gray'"></bgcolor>
</button>
The button will appear white when the user activates it, and gray otherwise.
The following example shows how the activated option can be set for an item based on user input. This use of the activated option works with the keypress option to establish a default button on the form.
<button sid="DefaultButton">
<type>cancel</type>
<activated>off</activated>
<custom:myoption compute="toggle(global.keypress, '', 

'ESC') == '1' ? set('activated','on') : 

''"></custom:myoption>
</button>
When the user presses the ESC key (which is not processed by any item on the form), the activated option for the button will be set to on and the button will fire.