- Direct Known Subclasses:
ListboxRenderer,SelectManyCheckboxListRenderer
UISelectOne or UISelectMany
component as a list of menu options.-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.faces.renderkit.html_basic.HtmlBasicRenderer
HtmlBasicRenderer.OptionComponentInfo, HtmlBasicRenderer.Param -
Field Summary
Fields inherited from class com.sun.faces.renderkit.html_basic.HtmlBasicRenderer
EMPTY_PARAMS, loggerFields inherited from class jakarta.faces.render.Renderer
PASSTHROUGH_RENDERER_LOCALNAME_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Object> bestGuess(Class<? extends Collection<Object>> type, int initialSize) protected Collection<Object> cloneValue(Object value) Utility method to invoke the theclonemethod on the provided value.protected ObjectcoerceToModelType(FacesContext ctx, Object value, Class<?> itemValueType) protected booleancontainsaValue(Object valueArray) convertSelectManyValue(FacesContext context, UISelectMany uiSelectMany, String[] newValues) protected ObjectconvertSelectManyValuesForArray(FacesContext context, UISelectMany uiSelectMany, Class<?> elementType, String[] newValues) protected Collection<Object> convertSelectManyValuesForCollection(FacesContext context, UISelectMany uiSelectMany, Class<? extends Collection<Object>> collectionType, String[] newValues) protected ObjectconvertSelectManyValuesForModel(FacesContext context, UISelectMany uiSelectMany, Class<?> modelType, String[] newValues) convertSelectOneValue(FacesContext context, UISelectOne uiSelectOne, String newValue) protected Collection<Object> createCollection(Collection<Object> collection, Class<? extends Collection<Object>> fallBackType) protected Collection<Object> createCollectionFromHint(Object collectionTypeHint) Create a collection from the provided hint.voiddecode(FacesContext context, UIComponent component) Decode any new state of the specifiedUIComponentfrom the request contained in the specifiedFacesContext, and store that state on theUIComponent.voidencodeBegin(FacesContext context, UIComponent component) Render the beginning specifiedUIComponentto the output stream or writer associated with the response we are creating.voidencodeEnd(FacesContext context, UIComponent component) Render the ending of the current state of the specifiedUIComponent, following the rules described forencodeBegin()to acquire the appropriate value to be rendered.getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) Attempt to convert previously stored state information into an object of the type required for this component (optionally using the registeredConverterfor this component, if there is one).protected ObjectgetCurrentSelectedValues(UIComponent component) protected StringgetMultipleText(UIComponent component) protected Object[]getSubmittedSelectedValues(UIComponent component) protected static booleanisHideNoSelection(UIComponent component) protected booleanisSelected(FacesContext context, UIComponent component, Object itemValue, Object valueArray, Converter<?> converter) protected booleanrenderOption(FacesContext context, UIComponent component, UIComponent selectComponent, Converter<?> converter, SelectItem curItem, Object currentSelections, Object[] submittedValues, HtmlBasicRenderer.OptionComponentInfo optionInfo) protected intrenderOptions(FacesContext context, UIComponent component, SelectItemsIterator<SelectItem> items) protected voidrenderSelect(FacesContext context, UIComponent component) protected voidwriteDefaultSize(ResponseWriter writer, int itemCount) Methods inherited from class com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer
getNonOnChangeBehaviors, getNonOnClickSelectBehaviors, getValue, setSubmittedValueMethods inherited from class com.sun.faces.renderkit.html_basic.HtmlBasicRenderer
augmentIdReference, convertClientId, decodeBehaviors, encodeRecursive, getBehaviorParameters, getChildren, getCurrentValue, getEndTextToRender, getFacet, getForComponent, getFormattedValue, getFormattedValue, getMessageIter, getParamList, getPassThruBehaviors, getRendersChildren, isBehaviorSource, rendererParamsNotNull, shouldDecode, shouldEncode, shouldEncodeChildren, shouldWriteIdAttribute, writeIdAttributeIfNecessaryMethods inherited from class jakarta.faces.render.Renderer
encodeChildren
-
Constructor Details
-
MenuRenderer
public MenuRenderer()
-
-
Method Details
-
convertSelectManyValue
public Object convertSelectManyValue(FacesContext context, UISelectMany uiSelectMany, String[] newValues) throws ConverterException - Throws:
ConverterException
-
convertSelectOneValue
public Object convertSelectOneValue(FacesContext context, UISelectOne uiSelectOne, String newValue) throws ConverterException - Throws:
ConverterException
-
decode
Description copied from class:RendererDecode any new state of the specified
UIComponentfrom the request contained in the specifiedFacesContext, and store that state on theUIComponent.During decoding, events may be enqueued for later processing (by event listeners that have registered an interest), by calling
queueEvent()on the associatedUIComponent.- Overrides:
decodein classHtmlBasicRenderer- Parameters:
context-FacesContextfor the request we are processingcomponent-UIComponentto be decoded.
-
encodeBegin
Description copied from class:RendererRender the beginning specified
UIComponentto the output stream or writer associated with the response we are creating. If the conversion attempted in a previous call togetConvertedValue()for this component failed, the state information saved during execution ofdecode()should be used to reproduce the incorrect input.- Overrides:
encodeBeginin classRenderer- Parameters:
context-FacesContextfor the request we are processingcomponent-UIComponentto be rendered- Throws:
IOException- if an input/output error occurs while rendering
-
encodeEnd
Description copied from class:RendererRender the ending of the current state of the specified
UIComponent, following the rules described forencodeBegin()to acquire the appropriate value to be rendered.- Overrides:
encodeEndin classHtmlBasicRenderer- Parameters:
context-FacesContextfor the response we are creatingcomponent-UIComponentto be rendered- Throws:
IOException- if an input/output error occurs while rendering
-
getConvertedValue
public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException Description copied from class:RendererAttempt to convert previously stored state information into an object of the type required for this component (optionally using the registered
Converterfor this component, if there is one). If conversion is successful, the new value should be returned from this method; if not, aConverterExceptionshould be thrown.- Overrides:
getConvertedValuein classHtmlBasicInputRenderer- Parameters:
context-FacesContextfor the request we are processingcomponent-UIComponentto be decoded.submittedValue- a value stored on the component duringdecode.- Returns:
- the converted value
- Throws:
ConverterException- if the submitted value cannot be converted successfully.
-
convertSelectManyValuesForModel
protected Object convertSelectManyValuesForModel(FacesContext context, UISelectMany uiSelectMany, Class<?> modelType, String[] newValues) -
convertSelectManyValuesForArray
protected Object convertSelectManyValuesForArray(FacesContext context, UISelectMany uiSelectMany, Class<?> elementType, String[] newValues) throws ConverterException - Throws:
ConverterException
-
convertSelectManyValuesForCollection
protected Collection<Object> convertSelectManyValuesForCollection(FacesContext context, UISelectMany uiSelectMany, Class<? extends Collection<Object>> collectionType, String[] newValues) -
renderOption
protected boolean renderOption(FacesContext context, UIComponent component, UIComponent selectComponent, Converter<?> converter, SelectItem curItem, Object currentSelections, Object[] submittedValues, HtmlBasicRenderer.OptionComponentInfo optionInfo) throws IOException - Throws:
IOException
-
writeDefaultSize
- Throws:
IOException
-
containsaValue
-
getCurrentSelectedValues
-
getMultipleText
-
getSubmittedSelectedValues
-
isSelected
protected boolean isSelected(FacesContext context, UIComponent component, Object itemValue, Object valueArray, Converter<?> converter) -
renderOptions
protected int renderOptions(FacesContext context, UIComponent component, SelectItemsIterator<SelectItem> items) throws IOException - Throws:
IOException
-
renderSelect
- Throws:
IOException
-
coerceToModelType
-
createCollection
protected Collection<Object> createCollection(Collection<Object> collection, Class<? extends Collection<Object>> fallBackType) - Parameters:
collection- a Collection instance- Returns:
- a new
Collectioninstance or null if the instance cannot be created
-
cloneValue
Utility method to invoke the the
clonemethod on the provided value.- Parameters:
value- the value to clone- Returns:
- the result of invoking
clone()ornullif the value could not be cloned or does not implement theCloneableinterface
-
bestGuess
- Parameters:
type- the target model typeinitialSize- the initial size of theCollection- Returns:
- a
Collectioninstance that best matchestype
-
createCollectionFromHint
Create a collection from the provided hint.
- Parameters:
collectionTypeHint- the Collection type as either a String or Class- Returns:
- a new Collection instance
-
isHideNoSelection
-