Package org.primefaces.renderkit
Class SelectRenderer
- java.lang.Object
-
- javax.faces.render.Renderer
-
- org.primefaces.renderkit.CoreRenderer
-
- org.primefaces.renderkit.InputRenderer
-
- org.primefaces.renderkit.SelectRenderer
-
- Direct Known Subclasses:
SelectManyRenderer
,SelectOneRenderer
public abstract class SelectRenderer extends InputRenderer
-
-
Field Summary
-
Fields inherited from class org.primefaces.renderkit.InputRenderer
ARIA_FILTER
-
-
Constructor Summary
Constructors Constructor Description SelectRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addSelectItem(javax.faces.component.UIInput component, List<javax.faces.model.SelectItem> selectItems, javax.faces.model.SelectItem item, boolean hideNoSelectOption)
protected Object
coerceToModelType(javax.faces.context.FacesContext ctx, Object value, Class<?> itemValueType)
protected int
countSelectItems(List<javax.faces.model.SelectItem> selectItems)
protected int
countSelectItems(javax.faces.model.SelectItem[] selectItems)
protected javax.faces.model.SelectItem
createSelectItem(javax.faces.context.FacesContext context, javax.faces.component.UISelectItems uiSelectItems, Object value, Object label)
protected javax.faces.convert.Converter
findImplicitConverter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
protected String
getOptionAsString(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, javax.faces.convert.Converter converter, Object value)
protected List<javax.faces.model.SelectItem>
getSelectItems(javax.faces.context.FacesContext context, javax.faces.component.UIInput component)
protected boolean
isHideNoSelection(javax.faces.component.UIComponent component)
protected boolean
isSelected(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object itemValue, Object valueArray, javax.faces.convert.Converter converter)
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.protected List<String>
validateSubmittedValues(javax.faces.context.FacesContext context, javax.faces.component.UIInput component, Object[] oldValues, String... submittedValues)
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)-
Methods inherited from class org.primefaces.renderkit.InputRenderer
createStyleClass, createStyleClass, getConvertedValue, isDisabled, isReadOnly, renderAccessibilityAttributes, renderAccessibilityAttributes, renderARIACombobox, renderARIAInvalid, renderARIARequired, renderRTLDirection, shouldDecode
-
Methods inherited from class org.primefaces.renderkit.CoreRenderer
buildAjaxRequest, buildAjaxRequest, buildAjaxRequest, buildDomEvent, buildNonAjaxRequest, buildNonAjaxRequest, decodeBehaviors, encodeClientBehaviors, endsWithLenghtUnit, getEventBehaviors, getHighlighter, getResourceRequestPath, getResourceURL, getStyleClassBuilder, getWidgetBuilder, isGrouped, isValueBlank, preConfiguredAjaxRequestBuilder, preConfiguredAjaxRequestBuilder, renderChild, renderChildren, renderDomEvent, renderDomEvents, renderDummyMarkup, renderDynamicPassThruAttributes, renderOnchange, renderOnclick, renderPassThruAttributes, renderPassThruAttributes, renderPassThruAttributes, renderValidationMetadata, shouldRenderAttribute, shouldWriteId
-
-
-
-
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 givenconverter
.value
- Second value to compare against the first. Should be the model value, i.e. not a string, unlessitemValue
is a string too.converter
- Optional converter defined for the select component.- Returns:
true
if the two values are equal, orfalse
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 FacesContextcomponent
- The componentoldValues
- The old value(s)submittedValues
- The submitted value(s)- Returns:
newSubmittedValues
merged with checked, disabledoldValues
- Throws:
javax.faces.FacesException
- if client side manipulation has been detected, in order to reject the submission
-
-