Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.richfaces.component;
  
  import  javax.faces.component.EditableValueHolder;
  import  javax.faces.context.FacesContext;
  import  javax.faces.event.AbortProcessingException;
  import  javax.faces.event.ComponentSystemEvent;
  import  javax.faces.event.ListenerFor;
  import  javax.faces.event.PostAddToViewEvent;
  import  javax.faces.validator.Validator;
 

The <rich:select> component provides a drop-down list box for selecting a single value from multiple options. The <rich:select> component can be configured as a combo-box, where it will accept typed input. The component also supports keyboard navigation. The <rich:select> component functions similarly to the JSF UISelectOne component.

Author(s):
abelevich
 
 @JsfComponent(type = ., family = ., generate = "org.richfaces.component.UISelect", renderer = @JsfRenderer(type = "org.richfaces.SelectRenderer"), tag = @Tag(name = "select"), attributes = {
         "core-props.xml""events-mouse-props.xml""events-key-props.xml""select-props.xml" })
 @ListenerFor(systemEventClass = PostAddToViewEvent.class)
 public abstract class AbstractSelect extends AbstractSelectComponent {
     public static final String COMPONENT_TYPE = "org.richfaces.Select";
     public static final String COMPONENT_FAMILY = "org.richfaces.Select";

    
If "true", this component is disabled
 
     @Attribute
     public abstract boolean isDisabled();

    

If "true" Allows the user to type into a text field to scroll through or filter the list

Default is "false"

 
     @Attribute()
     public abstract boolean isEnableManualInput();

    

If "true" as the user types to narrow the list, automatically select the first element in the list. Applicable only when enableManualInput is "true".

Default is "true"

 
     @Attribute(defaultValue = "true")
     public abstract boolean isSelectFirst();

    

When "true" display a button to expand the popup list

Default is "true"

 
     @Attribute(defaultValue = "true")
     public abstract boolean isShowButton();

    
The minimum height ot the list
 
     @Attribute()
     public abstract String getMinListHeight();

    
The maximum height of the list
 
     @Attribute()
     public abstract String getMaxListHeight();

    
A javascript function used to filter the list of items in the select popup
 
     @Attribute
     public abstract String getClientFilterFunction();
 
     @Attribute(hidden = true)
     public abstract String getActiveClass();
 
     @Attribute(hidden = true)
     public abstract String getChangedClass();
 
     @Attribute(hidden = true)
     public abstract String getDisabledClass();
 
    // --------- core-props.xml
    @Attribute
    public abstract String getStyle();
    @Attribute
    public abstract String getStyleClass();
    @Attribute
    public abstract String getTitle();
    @Override
    public void processEvent(ComponentSystemEvent eventthrows AbortProcessingException {
        super.processEvent(event);
        if (event instanceof PostAddToViewEvent) {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            EditableValueHolder component = (EditableValueHolder) event.getComponent();
            Validator validator = facesContext.getApplication().createValidator(.);
            component.addValidator(validator);
        }
    }
New to GrepCode? Check out our FAQ X