Ajax Action
a4j:ajax
a4j:commandButton
a4j:commandLink
a4j:actionListener
a4j:jsFunction
a4j:poll
a4j:push
a4j:param
Ajax Queue
a4j:queue
a4j:attachQueue
Ajax Output/Containers
a4j:outputPanel
a4j:status
a4j:region
a4j:mediaOutput
a4j:log
Validation
Client Side Validation
rich:graphValidator
rich:message
rich:messages
rich:notify
Data Iteration
a4j:repeat
rich:dataTable
rich:extendedDataTable
rich:collapsibleSubTable
rich:dataScroller
rich:list
rich:dataGrid
Trees
rich:tree
Tree Adaptors
Output/Panels
rich:chart
rich:panel
rich:togglePanel
rich:tabPanel
rich:collapsiblePanel
rich:accordion
rich:popupPanel
rich:progressBar
rich:tooltip
Menus
rich:panelMenu
rich:toolbar
rich:contextMenu
rich:dropDownMenu
Inputs
rich:autocomplete
rich:calendar
rich:editor
rich:inputNumberSlider
rich:inputNumberSpinner
rich:inplaceInput
rich:fileUpload
Selects
rich:inplaceSelect
rich:select
rich:orderingList
rich:pickList
Drag and Drop
Drag and Drop
Miscellaneous
Standard elements skinning
rich:placeholder
RichFaces functions
rich:focus
rich:componentControl
rich:hashParam
rich:hotKey
rich:jQuery

Focus component helps you manage focus of input components in the view.

The component can be used either in a form or in a view - there can be only one focus per form and, if both, form- and view-based focuses are defined, a form one takes a priority. A view-based focus defines behavior for all forms in a view.

Focus reflects results of validation of components in a view. Focus is given to a first input component in a page which is invalid. The order of input components is determined on client-side and it reflects tabindex and position in a page. You can prioritize focusing of specific component by increasing its tabindex.

Focus can be configured to keep focus on input component which has been focused before form submission.

Focus is applied each time it is rendered - either on form submission or after AJAX request. To turn off focusing after AJAX request, you can use ajaxRendered=false.


In following example, focus is initially given to Name input. If you enter invalid name (less than 3 chars) and submit (hit enter), focus is given again to Name input. This way user is directed to enter valid input.

Focus and Form Input Validation
Name:
Job:
Address:
Zip: