Class SelectRenderer

    • Constructor Detail

      • SelectRenderer

        public SelectRenderer()
    • Method Detail

      • 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)
      • 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