# rich

## Tag focus

- Description:

    Focus component allows to set focus based on validation of components or alternatively it can preserve focus on currently focused form input.

    Focus can be bound to form (in case of placement to h:form) or to whole view (when placed outside of forms) - in latter case, all forms will be managed by one Focus. There can be at most one Focus per form. When there is one view-scoped Focus and form defines own Focus, form-scoped Focus settings will be used.

    Focus is applied each time the component is rendered - for each full page submit and for each partial page request (in case of ajaxRendered=true). Alternatively, you can use JavaScript API: `applyFocus()` function will immediately cause.

- Component Information
  Info | Value
  --- | ---
  Component Type | `org.richfaces.Focus`
  Handler Class | None
  Renderer Type | `org.richfaces.FocusRenderer`
  Description | Focus component allows to set focus based on validation of components or alternatively it can preserve focus on currently focused form input. Focus can be bound to form (in case of placement to h:form) or to whole view (when placed outside of forms) - in latter case, all forms will be managed by one Focus. There can be at most one Focus per form. When there is one view-scoped Focus and form defines own Focus, form-scoped Focus settings will be used. Focus is applied each time the component is rendered - for each full page submit and for each partial page request (in case of ajaxRendered=true). Alternatively, you can use JavaScript API: `applyFocus()` function will immediately cause.

- Attributes
  Name | Required | Type | Description
  --- | --- | --- | ---
  `ajaxRendered` | `false` | `javax.el.ValueExpression` (must evaluate to `boolean`) | Defines whether focus state should be updated during each AJAX request automatically. (default: true)
  `binding` | `false` | `javax.el.ValueExpression` (must evaluate to `javax.faces.component.UIComponent`) | The value binding expression used to wire up this component to a component property of a JavaBean class
  `delayed` | `false` | `javax.el.ValueExpression` (must evaluate to `boolean`) | Defines whether focus should not be applied after initial page load, but will need to be triggered by JavaScript function from Focus API: `applyFocus()` or via re-rendering (postback).
  `id` | `false` | `javax.el.ValueExpression` (must evaluate to `java.lang.String`) | The component identifier for this component. This value must be unique within the closest parent component that is a naming container.
  `preserve` | `false` | `javax.el.ValueExpression` (must evaluate to `boolean`) | Defines whether focus should be preserved on last focused input before request was done (default: false)
  `rendered` | `false` | `javax.el.ValueExpression` (must evaluate to `boolean`) | Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true.
  `validationAware` | `false` | `javax.el.ValueExpression` (must evaluate to `boolean`) | Defines if focus should respect validation of inputs. If true, only invalid form fields will be focused when focus applied. (default: true)

Output generated by Vdldoc View Declaration Language Documentation Generator.