<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:ui="http://java.sun.com/jsf/facelets"xmlns:f="http://java.sun.com/jsf/core"xmlns:h="http://java.sun.com/jsf/html"xmlns:focus="http://richfaces.org/sandbox/focus"xmlns:rich="http://richfaces.org/rich"xmlns:a4j="http://richfaces.org/a4j"><head><title>Focus sample</title></head><body><ui:includesrc="menu.xhtml"/><p> Some components like h:selectOneRadio render elements that have identifiers matching component's clientId+suffix. This might be a pain if we want to have single "focus" component inside form, but be able to focus any type of the invalid components. That's what focusModifier component is for. Some components cause even grater pain cause you cannot nest anything inside (rich:calendar). To cope with this put focusModifier inside "focusModifier" facet. </p><h:form><focus:focus/><h:panelGridcolumns="3"><h:outputLabelvalue="Option"for="option"/><h:selectOneRadiovalue="#{option}"id="option"required="true"><f:selectItemitemLabel="Option 1"itemValue="1"/><f:selectItemitemLabel="Option 2"itemValue="2"/><f:selectItemitemLabel="Option 3"itemValue="3"/><focus:focusModifiersuffix=":2"/></h:selectOneRadio><h:messagefor="option"/><h:outputLabelvalue="Email"for="email"/><h:inputTextvalue="#{email}"id="email"required="true"/><h:messagefor="email"/><h:outputLabelvalue="Date"for="date"/><rich:calendarvalue="#{date}"id="date"enableManualInput="true"required="true"><f:facetname="focusModifier"><focus:focusModifiersuffix="InputDate"/></f:facet></rich:calendar><h:messagefor="date"/></h:panelGrid><h:commandButtonvalue="submit"/></h:form><rich:insertsrc="/focus_7.xhtml"highlight="html"/></body></html>