org.richfaces.component

## Class UIFocus

- java.lang.Object
- - javax.faces.component.UIComponent
  - - javax.faces.component.UIComponentBase
    - - javax.faces.component.UIOutput
      - - org.richfaces.component.AbstractFocus
        - - org.richfaces.component.UIFocus

- All Implemented Interfaces:
    EventListener, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.component.TransientStateHolder, javax.faces.component.ValueHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder, AjaxOutput

      @Generated(value={"RichFaces CDK","4.5.0-SNAPSHOT"})
      public class UIFocus
      extends AbstractFocus
      implements AjaxOutput

  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.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `UIFocus.Properties`

    - ### Nested classes/interfaces inherited from class org.richfaces.component.AbstractFocus

      `AbstractFocus.Mode`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `COMPONENT_FAMILY`
    `static String` | `COMPONENT_TYPE`

    - ### Fields inherited from class javax.faces.component.UIComponent

      `ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UIFocus()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getFamily()`
    `boolean` | `isAjaxRendered()` Defines whether focus state should be updated during each AJAX request automatically.
    `boolean` | `isDelayed()` 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).
    `boolean` | `isKeepTransient()` Hide keepTransient attribute from AjaxOutput
    `boolean` | `isPreserve()` Defines whether focus should be preserved on last focused input before request was done (default: false)
    `boolean` | `isValidationAware()` Defines if focus should respect validation of inputs.
    `void` | `setAjaxRendered(boolean ajaxRendered)` Setter for ajax rendered property.
    `void` | `setDelayed(boolean delayed)`
    `void` | `setKeepTransient(boolean keepTransient)` Setter for keep transient property.
    `void` | `setPreserve(boolean preserve)`
    `void` | `setValidationAware(boolean validationAware)`

    - ### Methods inherited from class org.richfaces.component.AbstractFocus

      `getMode, processEvent`

    - ### Methods inherited from class javax.faces.component.UIOutput

      `clearInitialState, getConverter, getLocalValue, getValue, markInitialState, restoreState, saveState, setConverter, setValue`

    - ### Methods inherited from class javax.faces.component.UIComponentBase

      `addClientBehavior, addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent`

    - ### Methods inherited from class javax.faces.component.UIComponent

      `encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTree`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### COMPONENT_TYPE

          public static final String COMPONENT_TYPE

      See Also:
        Constant Field Values

    - #### COMPONENT_FAMILY

          public static final String COMPONENT_FAMILY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### UIFocus

          public UIFocus()

  - ### Method Detail

    - #### getFamily

          public String getFamily()

      Overrides:
        `getFamily` in class `javax.faces.component.UIOutput`

    - #### isAjaxRendered

          public boolean isAjaxRendered()

      Description copied from class: `AbstractFocus`
      Defines whether focus state should be updated during each AJAX request automatically. (default: true)
      Specified by:
        `isAjaxRendered` in interface `AjaxOutput`
      Specified by:
        `isAjaxRendered` in class `AbstractFocus`
      Returns:
        ajax-rendered flag

    - #### setAjaxRendered

          public void setAjaxRendered(boolean ajaxRendered)

      Description copied from interface: `AjaxOutput`
      Setter for ajax rendered property.
      Specified by:
        `setAjaxRendered` in interface `AjaxOutput`

    - #### isDelayed

          public boolean isDelayed()

      Description copied from class: `AbstractFocus`
      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).
      Specified by:
        `isDelayed` in class `AbstractFocus`

    - #### setDelayed

          public void setDelayed(boolean delayed)

    - #### isKeepTransient

          public boolean isKeepTransient()

      Description copied from class: `AbstractFocus`
      Hide keepTransient attribute from AjaxOutput
      Specified by:
        `isKeepTransient` in interface `AjaxOutput`
      Specified by:
        `isKeepTransient` in class `AbstractFocus`
      Returns:
        keep transient property

    - #### setKeepTransient

          public void setKeepTransient(boolean keepTransient)

      Description copied from interface: `AjaxOutput`
      Setter for keep transient property.
      Specified by:
        `setKeepTransient` in interface `AjaxOutput`

    - #### isPreserve

          public boolean isPreserve()

      Description copied from class: `AbstractFocus`
      Defines whether focus should be preserved on last focused input before request was done (default: false)
      Specified by:
        `isPreserve` in class `AbstractFocus`

    - #### setPreserve

          public void setPreserve(boolean preserve)

    - #### isValidationAware

          public boolean isValidationAware()

      Description copied from class: `AbstractFocus`

      Defines if focus should respect validation of inputs.

      If true, only invalid form fields will be focused when focus applied.

      (default: true)

      Specified by:
        `isValidationAware` in class `AbstractFocus`

    - #### setValidationAware

          public void setValidationAware(boolean validationAware)

Copyright © 2015 JBoss by Red Hat. All Rights Reserved.