Class SelectRenderer

java.lang.Object
javax.faces.render.Renderer
Direct Known Subclasses:
SelectManyRenderer, SelectOneRenderer

public abstract class SelectRenderer extends InputRenderer
  • Constructor Details

    • SelectRenderer

      public SelectRenderer()
  • Method Details

    • isHideNoSelection

      protected boolean isHideNoSelection(javax.faces.component.UIComponent component)
    • addSelectItem

      protected void addSelectItem(javax.faces.component.UIInput component, List<javax.faces.model.SelectItem> selectItems, javax.faces.model.SelectItem item, boolean hideNoSelectOption)
    • getSelectItems

      protected List<javax.faces.model.SelectItem> getSelectItems(javax.faces.context.FacesContext context, javax.faces.component.UIInput component)
    • createSelectItem

      protected javax.faces.model.SelectItem createSelectItem(javax.faces.context.FacesContext context, javax.faces.component.UISelectItems uiSelectItems, Object value, Object label)
    • updateSelectItem

      protected javax.faces.model.SelectItem updateSelectItem(javax.faces.context.FacesContext context, javax.faces.component.UISelectItems uiSelectItems, javax.faces.model.SelectItem value)
    • getOptionAsString

      protected String getOptionAsString(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.convert.Converter converter, Object value) throws javax.faces.convert.ConverterException
      Throws:
      javax.faces.convert.ConverterException
    • findImplicitConverter

      protected javax.faces.convert.Converter findImplicitConverter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
    • coerceToModelType

      protected Object coerceToModelType(javax.faces.context.FacesContext ctx, Object value, Class<?> itemValueType)
    • isSelected

      protected boolean isSelected(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object itemValue, Object valueArray, javax.faces.convert.Converter converter)
    • isSelectValueEqual

      protected boolean isSelectValueEqual(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object itemValue, Object value, javax.faces.convert.Converter converter)
      Compares two select options against each other. Values can be either a serialized string, or the actual object, this method takes care of the conversion.
      Parameters:
      context - The currently active faces context.
      component - The select component for which to compare values.
      itemValue - First value to compare against the second. May be a submitted string value, in which case it run through the given converter.
      value - Second value to compare against the first. Should be the model value, i.e. not a string, unless itemValue is a string too.
      converter - Optional converter defined for the select component.
      Returns:
      true if the two values are equal, or false otherwise.
    • countSelectItems

      protected int countSelectItems(List<javax.faces.model.SelectItem> selectItems)
    • countSelectItems

      protected int countSelectItems(javax.faces.model.SelectItem[] selectItems)
    • validateSubmittedValues

      protected List<String> validateSubmittedValues(javax.faces.context.FacesContext context, javax.faces.component.UIInput component, Object[] oldValues, String... submittedValues) throws javax.faces.FacesException
      Restores checked, disabled select items (#3296) and checks if at least one disabled select item has been submitted - this may occur with client side manipulation (#3264)
      Parameters:
      context - The FacesContext
      component - The component
      oldValues - The old value(s)
      submittedValues - The submitted value(s)
      Returns:
      newSubmittedValues merged with checked, disabled oldValues
      Throws:
      javax.faces.FacesException - if client side manipulation has been detected, in order to reject the submission
    • getSelectItemComponent

      public javax.faces.component.UIComponent getSelectItemComponent(javax.faces.model.SelectItem item)
      Helper method to find the defining component of a SelectItem so passthrough attributes can be rendered.
      Parameters:
      item - the SelectItem to check
      Returns:
      either NULL or a component the SelectItem was defined by