Class UISelectMany

All Implemented Interfaces:
EditableValueHolder, PartialStateHolder, StateHolder, TransientStateHolder, ValueHolder, ComponentSystemEventListener, FacesListener, SystemEventListenerHolder, EventListener
Direct Known Subclasses:
HtmlSelectManyCheckbox, HtmlSelectManyListbox, HtmlSelectManyMenu

@JSFComponent(defaultRendererType="jakarta.faces.Listbox") @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 Details

  • Constructor Details

    • UISelectMany

      public UISelectMany()
  • Method Details

    • getFamily

      public String getFamily()
      Overrides:
      getFamily in class UIInput
    • getSelectedValues

      public Object[] getSelectedValues()
    • setSelectedValues

      public void setSelectedValues(Object[] selectedValues)
    • getValueExpression

      public jakarta.el.ValueExpression getValueExpression(String name)
      Overrides:
      getValueExpression in class UIComponent
    • setValueExpression

      public void setValueExpression(String name, jakarta.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
    • 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:

      • If the submittedValue is not a String then just return the submittedValue unconverted.
      • If there is no "value" value-binding then just return the submittedValue unconverted.
      • Use introspection to determine the type of the target property specified by the value-binding, and then use Application.createConverter to find a converter that can map from String to the required type. Apply the converter to the submittedValue and return the result.
      Overrides:
      getConvertedValue in class UIInput
      Throws:
      ConverterException