- java.lang.Object
-
- javax.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
UISelectMany
orUISelectOne
component.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SelectItem()
Construct 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
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description String
getDescription()
Return a description of this item, for use in development tools.String
getLabel()
Return the label of this item, to be rendered visibly for the user.Object
getValue()
Return the value of this item, to be delivered to the model if this item is selected by the user.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 totrue
.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.boolean
isNoSelectionOption()
Return the value of the
noSelectionOption
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
setLabel(String label)
Set the label of this item, to be rendered visibly for the user.void
setNoSelectionOption(boolean noSelectionOption)
Set the value of the
noSelectionOption
property.void
setValue(Object value)
Set the value of this item, to be delivered to the model if this item is selected by this user.
-
-
-
Constructor Detail
-
SelectItem
public SelectItem()
Construct a
SelectItem
with no initialized property values.
-
SelectItem
public SelectItem(Object value)
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
public SelectItem(Object value, String label)
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
public SelectItem(Object value, String label, String description)
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
public SelectItem(Object value, String label, String description, boolean disabled)
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
public SelectItem(Object value, String label, String description, boolean disabled, boolean escape)
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 Detail
-
getDescription
public String getDescription()
Return a description of this item, for use in development tools.
-
setDescription
public void setDescription(String description)
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
.
-
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
public String getLabel()
Return the label of this item, to be rendered visibly for the user.
-
setLabel
public void setLabel(String label)
Set the label of this item, to be rendered visibly for the user.
- Parameters:
label
- The new label
-
getValue
public Object getValue()
Return the value of this item, to be delivered to the model if this item is selected by the user.
-
setValue
public 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
-
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.- Since:
- 2.0
-
setEscape
public void setEscape(boolean escape)
Set the value of the escape property. See
isEscape()
.- 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(javax.faces.context.FacesContext, java.lang.Object)
andUISelectMany.validateValue(javax.faces.context.FacesContext, java.lang.Object)
for usage.- Since:
- 2.0
-
setNoSelectionOption
public void setNoSelectionOption(boolean noSelectionOption)
Set the value of the
noSelectionOption
property.- Since:
- 2.0
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/faces/model/selectitem.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.