focused

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.

Syntax

   <focused>status</focused>
Table 1. focused parameters
Parameter Type Description
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.

   <button sid="saveButton">
      <type>saveas</type>
      <value>Save</value>
      <focused>off</focused>
      <bgcolor compute="focused=='on' ? 'white' : 'blue'"></bgcolor>
   </button>

The following example shows how the focus can be moved to a different item based on user input.

   <check sid="CHECK1">
      <value>off<value>
      <label>Check here to skip next section</label>
      <custom:myoption compute="toggle(value, 'off', 'on') == &#xA;
         '1' ? set('FIELD14.focused','on'): ''"></custom:myoption>
   </check>

Usage details

  1. Default: off
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. The focused option is not included in form descriptions that are saved or transmitted.