Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * JBoss, Home of Professional Open Source
   * Copyright , Red Hat, Inc. and individual contributors
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * Lesser General Public License for more details.
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site:
 package org.richfaces.component;
 import java.util.List;
 import  javax.faces.context.FacesContext;
 import  javax.faces.component.UIComponent;
 import  javax.faces.component.behavior.ClientBehaviorHolder;
 import  javax.faces.component.StateHelper;
 import  org.ajax4jsf.component.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.

 @Generated({"RichFaces CDK""4.3.1.Final"})
 public class UIFocus extends AbstractFocus
     implements AjaxOutput    {
     public static final String COMPONENT_TYPE="org.richfaces.Focus";
     public static final String COMPONENT_FAMILY="org.richfaces.Focus";
     public String getFamily() {
         return ;
     public UIFocus() {
     protected enum Properties {
     public boolean isAjaxRendered() {
         Boolean value = (BooleangetStateHelper().eval(.true);
         return value;
     public void setAjaxRendered(boolean ajaxRendered) {
    public boolean isDelayed() {
        Boolean value = (BooleangetStateHelper().eval(.false);
        return value;
    public void setDelayed(boolean delayed) {
    public boolean isKeepTransient() {
        Boolean value = (BooleangetStateHelper().eval(.false);
        return value;
    public void setKeepTransient(boolean keepTransient) {
    public boolean isPreserve() {
        Boolean value = (BooleangetStateHelper().eval(.false);
        return value;
    public void setPreserve(boolean preserve) {
    public boolean isValidationAware() {
        Boolean value = (BooleangetStateHelper().eval(.true);
        return value;
    public void setValidationAware(boolean validationAware) {
New to GrepCode? Check out our FAQ X