javax.faces.component
Class UISelectMany

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by javax.faces.component.UISelectMany
All Implemented Interfaces:
EventListener, EditableValueHolder, PartialStateHolder, StateHolder, ValueHolder, ComponentSystemEventListener, FacesListener, SystemEventListenerHolder

@JSFComponent(defaultRendererType="javax.faces.Listbox")
@JSFJspProperties(properties={@JSFJspProperty(name="hideNoSelectionOption",returnType="boolean"),@JSFJspProperty(name="collectionType",returnType="java.lang.String")})
public class UISelectMany
extends UIInput

Base class for the various component classes that allow a user to select zero or more options from a set.

This is not an abstract class; java code can create an instance of this, configure its rendererType appropriately, and add it to a view. However there is no tag class for this component, ie it cannot be added directly to a page when using JSP (and other presentation technologies are expected to behave similarly). Instead, there is a family of subclasses that extend this base functionality, and they do have tag classes.

See the javadoc for this class in the JSF Specification for further details.


Field Summary
static String COMPONENT_FAMILY
           
static String COMPONENT_TYPE
           
static String INVALID_MESSAGE_ID
           
 
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID, VALIDATE_EMPTY_FIELDS_PARAM_NAME
 
Fields inherited from class javax.faces.component.UIComponent
BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY
 
Constructor Summary
UISelectMany()
           
 
Method Summary
protected  boolean compareValues(Object previous, Object value)
           
protected  Object getConvertedValue(FacesContext context, Object submittedValue)
          Convert the provided object to the desired value.
 String getFamily()
           
 Object[] getSelectedValues()
           
 ValueBinding getValueBinding(String name)
          Deprecated. Use getValueExpression instead
 javax.el.ValueExpression getValueExpression(String name)
           
 void setSelectedValues(Object[] selectedValues)
           
 void setValueBinding(String name, ValueBinding binding)
          Deprecated. Use setValueExpression instead
 void setValueExpression(String name, javax.el.ValueExpression binding)
           
 void validate(FacesContext context)
          First part is identical to super.validate except the empty condition.
protected  void validateValue(FacesContext context, Object convertedValue)
           
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, broadcast, clearInitialState, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValue, getValueChangeListener, getValueChangeListeners, isEmpty, isImmediate, isLocalValueSet, isRequired, isValid, markInitialState, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, restoreState, saveState, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addClientBehavior, addFacesListener, encodeAll, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, initialStateMarked, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, visitTree
 
Methods inherited from class javax.faces.component.UIComponent
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, setInView, subscribeToEvent, unsubscribeFromEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, setConverter
 

Field Detail

COMPONENT_TYPE

public static final String COMPONENT_TYPE
See Also:
Constant Field Values

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY
See Also:
Constant Field Values

INVALID_MESSAGE_ID

public static final String INVALID_MESSAGE_ID
See Also:
Constant Field Values
Constructor Detail

UISelectMany

public UISelectMany()
Method Detail

getFamily

public String getFamily()
Overrides:
getFamily in class UIInput

getSelectedValues

public Object[] getSelectedValues()

setSelectedValues

public void setSelectedValues(Object[] selectedValues)

getValueBinding

public ValueBinding getValueBinding(String name)
Deprecated. Use getValueExpression instead

Description copied from class: UIComponentBase
Get the named value-binding associated with this component.

Value-bindings are stored in a map associated with the component, though there is commonly a property (setter/getter methods) of the same name defined on the component itself which evaluates the value-binding when called.

Overrides:
getValueBinding in class UIComponentBase

setValueBinding

public void setValueBinding(String name,
                            ValueBinding binding)
Deprecated. Use setValueExpression instead

Description copied from class: UIComponentBase
Put the provided value-binding into a map of value-bindings associated with this component.

Overrides:
setValueBinding in class UIComponentBase

getValueExpression

public javax.el.ValueExpression getValueExpression(String name)
Overrides:
getValueExpression in class UIComponent

setValueExpression

public void setValueExpression(String name,
                               javax.el.ValueExpression binding)
Overrides:
setValueExpression in class UIComponent

compareValues

protected boolean compareValues(Object previous,
                                Object value)
Overrides:
compareValues in class UIInput
Returns:
true if Objects are different (!)

validateValue

protected void validateValue(FacesContext context,
                             Object convertedValue)
Overrides:
validateValue in class UIInput

validate

public void validate(FacesContext context)
First part is identical to super.validate except the empty condition. Second part: iterate through UISelectItem and UISelectItems and check current values against these items

Overrides:
validate in class UIInput

getConvertedValue

protected Object getConvertedValue(FacesContext context,
                                   Object submittedValue)
                            throws ConverterException
Description copied from class: UIInput
Convert the provided object to the desired value.

If there is a renderer for this component, then call the renderer's getConvertedValue method. While this can of course be implemented in any way the renderer desires, it typically performs exactly the same processing that this method would have done anyway (ie that described below for the no-renderer case).

Otherwise:

Overrides:
getConvertedValue in class UIInput
Throws:
ConverterException


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.