Class SelectItem
- java.lang.Object
- 
- jakarta.faces.model.SelectItem
 
- 
- All Implemented Interfaces:
- Serializable
 - Direct Known Subclasses:
- SelectItemGroup
 
 public class SelectItem extends Object implements Serializable SelectItem represents a single item in the list of supported items associated with a UISelectManyorUISelectOnecomponent.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description SelectItem()Construct aSelectItemwith no initialized property values.SelectItem(Object value)Construct aSelectItemwith the specified value.SelectItem(Object value, String label)Construct aSelectItemwith the specified value and label.SelectItem(Object value, String label, String description)Construct aSelectIteminstance with the specified value, label and description.SelectItem(Object value, String label, String description, boolean disabled)Construct aSelectIteminstance with the specified property values.SelectItem(Object value, String label, String description, boolean disabled, boolean escape)Construct aSelectIteminstance with the specified property values.SelectItem(Object value, String label, String description, boolean disabled, boolean escape, boolean noSelectionOption)Construct aSelectIteminstance with the specified property values.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDescription()Return a description of this item, for use in development tools.StringgetLabel()Return the label of this item, to be rendered visibly for the user.ObjectgetValue()Return the value of this item, to be delivered to the model if this item is selected by the user.booleanisDisabled()Return the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set totrue.booleanisEscape()If and only if this returnstrue, the code that renders this select item must escape the label using escaping syntax appropriate to the content type being rendered.booleanisNoSelectionOption()Return the value of thenoSelectionOptionproperty.voidsetDescription(String description)Set the description of this item, for use in development tools.voidsetDisabled(boolean disabled)Set the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set totrue.voidsetEscape(boolean escape)Set the value of the escape property.voidsetLabel(String label)Set the label of this item, to be rendered visibly for the user.voidsetNoSelectionOption(boolean noSelectionOption)Set the value of thenoSelectionOptionproperty.voidsetValue(Object value)Set the value of this item, to be delivered to the model if this item is selected by this user.
 
- 
- 
- 
Constructor Detail- 
SelectItempublic SelectItem() Construct a SelectItemwith no initialized property values.
 - 
SelectItempublic SelectItem(Object value) Construct a SelectItemwith the specified value. Thelabelproperty will be set to the value (converted to a String, if necessary), thedescriptionproperty will be set tonull, thedisabledproperty will be set tofalse, and theescapeproperty will be set to (true.- Parameters:
- value- Value to be delivered to the model if this item is selected by the user
 
 - 
SelectItempublic SelectItem(Object value, String label) Construct a SelectItemwith the specified value and label. Thedescriptionproperty will be set tonull, thedisabledproperty will be set tofalse, and theescapeproperty will be set totrue.- Parameters:
- value- Value to be delivered to the model if this item is selected by the user
- label- Label to be rendered for this item in the response
 
 - 
SelectItempublic SelectItem(Object value, String label, String description) Construct a SelectIteminstance with the specified value, label and description. Thisdisabledproperty will be set tofalse, and theescapeproperty will be set totrue.- Parameters:
- value- Value to be delivered to the model if this item is selected by the user
- label- Label to be rendered for this item in the response
- description- Description of this item, for use in tools
 
 - 
SelectItempublic SelectItem(Object value, String label, String description, boolean disabled) Construct a SelectIteminstance with the specified property values. Theescapeproperty will be set totrue.- Parameters:
- value- Value to be delivered to the model if this item is selected by the user
- label- Label to be rendered for this item in the response
- description- Description of this item, for use in tools
- disabled- Flag indicating that this option is disabled
 
 - 
SelectItempublic SelectItem(Object value, String label, String description, boolean disabled, boolean escape) Construct a SelectIteminstance with the specified property values.- Parameters:
- value- Value to be delivered to the model if this item is selected by the user
- label- Label to be rendered for this item in the response
- description- Description of this item, for use in tools
- disabled- Flag indicating that this option is disabled
- escape- Flag indicating that the text of this option should be escaped when rendered.
- Since:
- 1.2
 
 - 
SelectItempublic SelectItem(Object value, String label, String description, boolean disabled, boolean escape, boolean noSelectionOption) Construct a SelectIteminstance with the specified property values.- Parameters:
- value- Value to be delivered to the model if this item is selected by the user
- label- Label to be rendered for this item in the response
- description- Description of this item, for use in tools
- disabled- Flag indicating that this option is disabled
- escape- Flag indicating that the text of this option should be escaped when rendered.
- noSelectionOption- Flag indicating that the current option is a "no selection" option
- Since:
- 1.2
 
 
- 
 - 
Method Detail- 
getDescriptionpublic String getDescription() Return a description of this item, for use in development tools. - Returns:
- a description of this item, for use in development tools
 
 - 
setDescriptionpublic void setDescription(String description) Set the description of this item, for use in development tools. - Parameters:
- description- The new description
 
 - 
isDisabledpublic boolean isDisabled() Return the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.- Returns:
- the disabled flag for this item
 
 - 
setDisabledpublic void setDisabled(boolean disabled) Set the disabled flag for this item, which should modify the rendered output to make this item unavailable for selection by the user if set to true.- Parameters:
- disabled- The new disabled flag
 
 - 
getLabelpublic String getLabel() Return the label of this item, to be rendered visibly for the user. - Returns:
- the label of this item
 
 - 
setLabelpublic void setLabel(String label) Set the label of this item, to be rendered visibly for the user. - Parameters:
- label- The new label
 
 - 
getValuepublic Object getValue() Return the value of this item, to be delivered to the model if this item is selected by the user. - Returns:
- the value of this item
 
 - 
setValuepublic void setValue(Object value) Set the value of this item, to be delivered to the model if this item is selected by this user. - Parameters:
- value- The new value
 
 - 
isEscapepublic boolean isEscape() If and only if this returns true, the code that renders this select item must escape the label using escaping syntax appropriate to the content type being rendered.- Returns:
- the escape value.
- Since:
- 2.0
 
 - 
setEscapepublic void setEscape(boolean escape) Set the value of the escape property. See isEscape().- Parameters:
- escape- the new value of the escape property
- Since:
- 2.0
 
 - 
isNoSelectionOptionpublic boolean isNoSelectionOption() Return the value of the noSelectionOptionproperty. If the value of this property istrue, the system interprets the option represented by thisSelectIteminstance as representing a "no selection" option. SeeUISelectOne.validateValue(jakarta.faces.context.FacesContext, java.lang.Object)andUISelectMany.validateValue(jakarta.faces.context.FacesContext, java.lang.Object)for usage.- Returns:
- the value of the noSelectionOptionproperty
- Since:
- 2.0
 
 - 
setNoSelectionOptionpublic void setNoSelectionOption(boolean noSelectionOption) Set the value of the noSelectionOptionproperty.- Parameters:
- noSelectionOption- the new value of the- noSelectionOptionproperty
- Since:
- 2.0
 
 
- 
 
-