- java.lang.Object
-
- org.omnifaces.util.selectitems.SelectItemsUtils
-
public final class SelectItemsUtils extends Object
Collection of utility methods for working withSelectItem
or data represented by them.- Author:
- Arjan Tijms
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Object>
collectAllValuesFromSelectItems(FacesContext context, UIComponent component)
Collects all values associated with allSelectItem
instances associated with the given component.static Object
findValueByStringConversion(FacesContext context, UIComponent component, String value, Converter<Object> converter)
Finds an object value in theSelectItem
instances associated with the given component by means of matching its converted value with the given string value.
-
-
-
Method Detail
-
findValueByStringConversion
public static Object findValueByStringConversion(FacesContext context, UIComponent component, String value, Converter<Object> converter)
Finds an object value in theSelectItem
instances associated with the given component by means of matching its converted value with the given string value.- Parameters:
context
- The involved faces context.component
- the component with whichSelectItem
s should be associated that are used to search in.value
- a string that should match the string representation of one of the values held by theSelectItem
s.converter
- the facesConverter
used to generate String representations for the values held by theSelectItem
s.- Returns:
- the Object representation of the value where its string representation matches the input value.
-
collectAllValuesFromSelectItems
public static List<Object> collectAllValuesFromSelectItems(FacesContext context, UIComponent component)
Collects all values associated with allSelectItem
instances associated with the given component.Note that values from recursively scanned
SelectItemGroup
instances are included.- Parameters:
context
- The involved faces context.component
- the component with whichSelectItem
instances should be associated- Returns:
- List of all values hold by
SelectItem
instances
-
-