UISelectItem (Java EE 5)

Java EE API


javax.faces.component Class UISelectItem

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UISelectItem
All Implemented Interfaces:
StateHolder

public class UISelectItem
extends UIComponentBase


UISelectItem 是可以嵌入 UISelectManyUISelectOne 组件内部的组件,并且会导致将 SelectItem 实例添加到父组件的可用选项列表。可以通过以下方式之一指定 SelectItem 的内容:

英文文档:

UISelectItem is a component that may be nested inside a UISelectMany or UISelectOne component, and causes the addition of a SelectItem instance to the list of available options for the parent component. The contents of the SelectItem can be specified in one of the following ways:

  • The value attribute's value is an instance of SelectItem.
  • The associated ValueExpression points at a model data item of type SelectItem.
  • A new SelectItem instance is synthesized from the values of the itemDescription, itemDisabled, itemLabel, and itemValue attributes.


Field Summary
static String
static String
 
Fields inherited from class javax.faces.component.UIComponent
 
Constructor Summary
 
Method Summary
 String
 String
 String
 Object
 Object
 boolean
 boolean
 void
 Object
 void
 void
 void
 void
 void
 void
 
Methods inherited from class javax.faces.component.UIComponentBase
 
Methods inherited from class javax.faces.component.UIComponent
 
Methods inherited from class java.lang.Object
 

Field Detail

英文文档:

COMPONENT_TYPE

public static final String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values


英文文档:

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY

The standard component family for this component.

See Also:
Constant Field Values

Constructor Detail

public UISelectItem()

使用默认属性值创建新的 UISelectItem 实例。

英文文档:

UISelectItem

public UISelectItem()

Create a new UISelectItem instance with default property values.

Method Detail

public String getFamily()
英文文档:

getFamily

public String getFamily()
Description copied from class: UIComponent

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public String getItemDescription()

返回此选定项的描述。

英文文档:

getItemDescription

public String getItemDescription()

Return the description for this selection item.


public void setItemDescription(String itemDescription)

设置此选定项的描述。

itemDescription 新的描述
英文文档:

setItemDescription

public void setItemDescription(String itemDescription)

Set the description for this selection item.

Parameters:
itemDescription - The new description

public boolean isItemDisabled()

返回此选定项的禁用设置。

英文文档:

isItemDisabled

public boolean isItemDisabled()

Return the disabled setting for this selection item.


public void setItemDisabled(boolean itemDisabled)

设置此选定项的禁用值。

itemDisabled 新的禁用标志
英文文档:

setItemDisabled

public void setItemDisabled(boolean itemDisabled)

Set the disabled value for this selection item.

Parameters:
itemDisabled - The new disabled flag

public boolean isItemEscaped()

选择此选定项标签的转义设置。

英文文档:

isItemEscaped

public boolean isItemEscaped()

Return the escape setting for the label of this selection item.


public void setItemEscaped(boolean itemEscaped)

设置此选定项标签的转义值。

itemEscaped 新的禁用标志
英文文档:

setItemEscaped

public void setItemEscaped(boolean itemEscaped)

Set the escape value for the label of this selection item.

Parameters:
itemEscaped - The new disabled flag

public String getItemLabel()

返回此选定项的本地化标签。

英文文档:

getItemLabel

public String getItemLabel()

Return the localized label for this selection item.


public void setItemLabel(String itemLabel)

设置此选定项的本地化标签。

itemLabel 新的本地化标签
英文文档:

setItemLabel

public void setItemLabel(String itemLabel)

Set the localized label for this selection item.

Parameters:
itemLabel - The new localized label

public Object getItemValue()

返回此选定项的服务器值。

英文文档:

getItemValue

public Object getItemValue()

Return the server value for this selection item.


public void setItemValue(Object itemValue)

设置此选定项的服务器值。

itemValue 新的服务器值
英文文档:

setItemValue

public void setItemValue(Object itemValue)

Set the server value for this selection item.

Parameters:
itemValue - The new server value

public Object getValue()

返回 UISelectItemvalue 属性。

英文文档:

getValue

public Object getValue()

Returns the value property of the UISelectItem.


public void setValue(Object value)

设置 UISelectItemvalue 属性。

value 新值
英文文档:

setValue

public void setValue(Object value)

Sets the value property of the UISelectItem.

Parameters:
value - the new value

public Object saveState(FacesContext context)
英文文档:

saveState

public Object saveState(FacesContext context)
Description copied from interface: StateHolder

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);
 

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

public void restoreState(FacesContext context, Object state)
英文文档:

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from interface: StateHolder

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!