focusedAdded by IBM on August 8, 2013 | Version 1 (Original)
|Specifies whether an item, page, or form currently has the input focus. This option is usually set by code outside XFDL, but can also be set by a compute, provided that the compute is setting the focus of an item to on, the item is on the same page, and the item receiving the focus is capable of doing so.
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.
Table 1. focused parameters
|status||on||item, page, or form has input focus.|
|off||item, page, or form does not have input focus.|
Available in button, check, checkgroup, combobox, field, list, popup, radio, radiogroup, richtext, slider, page global, form global
Example The following example shows a button that changes its color to white if it has the input focus, and to blue if it does not.
The following example shows how the focus can be moved to a different item based on user input.
<bgcolor compute="focused=='on' ? 'white' : 'blue'"></bgcolor>
<label>Check here to skip next section</label>
<custom:myoption compute="toggle(value, 'off', 'on') ==
'1' ? set('FIELD14.focused','on'): ''"></custom:myoption>
- Default: off
- The focused option is set to on when an item, page, or form receives the input focus, and is set to off when the focus is moved to another item, page or form.
- An object's focused option does not change when the form application displaying it becomes active or inactive on a desktop. For example, a page that is open on screen will have a focused option set to on, even if the page is minimized or is not the currently active application on the desktop.
- In objects that are hierarchical, it is possible for more than one object to have the focus at one time. For example, a form, a page, and a field can all be focused at the same time.
- When a form viewing application is closing a form, it should set all focused options to off and then resolve all formulas before shutting down.
- The focused option is not included in form descriptions that are saved or transmitted.