Project Documentation
Foundation

Description

This component provides a way to control which component receives focus when the page loads.

Screen Shot

Not Available

API

component-family javax.faces.Output
renderer-type org.apache.myfaces.Focus
component-class org.apache.myfaces.custom.focus.HtmlFocus
renderer-class org.apache.myfaces.custom.focus.HtmlFocusRenderer
tag-class org.apache.myfaces.custom.focus.HtmlFocusTag

Usage

<h:inputText id="textfield" value="#{bean.value}" />
<s:focus id="focus" for="textfield" />
<s:focus id="focus" for="#{bean.focusedComponentId}" />

Syntax

<s:focus>

for="reference to UIComponent"

Additional Information

This component must be placed on the page in such a way that it is rendered after all components to which it might contain a reference. Generally, the best place for this component is right before the closing form tag.