- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SelectItemGroup
SelectItem represents a single item
in the list of supported items associated with a UISelectMany
or UISelectOne
component.
- See Also:
-
Constructor Summary
ConstructorDescriptionConstruct aSelectItem
with no initialized property values.SelectItem
(Object value) Construct aSelectItem
with the specified value.SelectItem
(Object value, String label) Construct aSelectItem
with the specified value and label.SelectItem
(Object value, String label, String description) Construct aSelectItem
instance with the specified value, label and description.SelectItem
(Object value, String label, String description, boolean disabled) Construct aSelectItem
instance with the specified property values.SelectItem
(Object value, String label, String description, boolean disabled, boolean escape) Construct aSelectItem
instance with the specified property values.SelectItem
(Object value, String label, String description, boolean disabled, boolean escape, boolean noSelectionOption) Construct aSelectItem
instance with the specified property values. -
Method Summary
Modifier and TypeMethodDescriptionReturn a description of this item, for use in development tools.getLabel()
Return the label of this item, to be rendered visibly for the user.getValue()
Return the value of this item, to be delivered to the model if this item is selected by the user.boolean
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
.boolean
isEscape()
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.boolean
Return the value of thenoSelectionOption
property.void
setDescription
(String description) Set the description of this item, for use in development tools.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 totrue
.void
setEscape
(boolean escape) Set the value of the escape property.void
Set the label of this item, to be rendered visibly for the user.void
setNoSelectionOption
(boolean noSelectionOption) Set the value of thenoSelectionOption
property.void
Set the value of this item, to be delivered to the model if this item is selected by this user.
-
Constructor Details
-
SelectItem
public SelectItem()Construct a
SelectItem
with no initialized property values. -
SelectItem
Construct a
SelectItem
with the specified value. Thelabel
property will be set to the value (converted to a String, if necessary), thedescription
property will be set tonull
, thedisabled
property will be set tofalse
, and theescape
property will be set to (true
.- Parameters:
value
- Value to be delivered to the model if this item is selected by the user
-
SelectItem
Construct a
SelectItem
with the specified value and label. Thedescription
property will be set tonull
, thedisabled
property will be set tofalse
, and theescape
property will be set totrue
.- Parameters:
value
- Value to be delivered to the model if this item is selected by the userlabel
- Label to be rendered for this item in the response
-
SelectItem
Construct a
SelectItem
instance with the specified value, label and description. Thisdisabled
property will be set tofalse
, and theescape
property will be set totrue
.- Parameters:
value
- Value to be delivered to the model if this item is selected by the userlabel
- Label to be rendered for this item in the responsedescription
- Description of this item, for use in tools
-
SelectItem
Construct a
SelectItem
instance with the specified property values. Theescape
property will be set totrue
.- Parameters:
value
- Value to be delivered to the model if this item is selected by the userlabel
- Label to be rendered for this item in the responsedescription
- Description of this item, for use in toolsdisabled
- Flag indicating that this option is disabled
-
SelectItem
Construct a
SelectItem
instance with the specified property values.- Parameters:
value
- Value to be delivered to the model if this item is selected by the userlabel
- Label to be rendered for this item in the responsedescription
- Description of this item, for use in toolsdisabled
- Flag indicating that this option is disabledescape
- Flag indicating that the text of this option should be escaped when rendered.- Since:
- 1.2
-
SelectItem
public SelectItem(Object value, String label, String description, boolean disabled, boolean escape, boolean noSelectionOption) Construct a
SelectItem
instance with the specified property values.- Parameters:
value
- Value to be delivered to the model if this item is selected by the userlabel
- Label to be rendered for this item in the responsedescription
- Description of this item, for use in toolsdisabled
- Flag indicating that this option is disabledescape
- 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 Details
-
getDescription
Return a description of this item, for use in development tools.
- Returns:
- a description of this item, for use in development tools
-
setDescription
Set the description of this item, for use in development tools.
- Parameters:
description
- The new description
-
isDisabled
public 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
-
setDisabled
public 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
-
getLabel
Return the label of this item, to be rendered visibly for the user.
- Returns:
- the label of this item
-
setLabel
Set the label of this item, to be rendered visibly for the user.
- Parameters:
label
- The new label
-
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
-
setValue
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
-
isEscape
public 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
-
setEscape
public 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
-
isNoSelectionOption
public boolean isNoSelectionOption()Return the value of the
noSelectionOption
property. If the value of this property istrue
, the system interprets the option represented by thisSelectItem
instance 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
noSelectionOption
property - Since:
- 2.0
-
setNoSelectionOption
public void setNoSelectionOption(boolean noSelectionOption) Set the value of the
noSelectionOption
property.- Parameters:
noSelectionOption
- the new value of thenoSelectionOption
property- Since:
- 2.0
-