UISelectItems (Java EE 5)

Java EE API


javax.faces.component Class UISelectItems

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

public class UISelectItems
extends UIComponentBase


UISelectItems 是可以嵌入 UISelectManyUISelectOne 组件内部的组件,并且会导致将一个或多个 SelectItem 实例添加到父组件的可用选项列表。此组件的 value(直接设置,或通过 javax.el.ValueExpression 间接获得)可以为以下任一类型:

  • SelectItem 的单个实例 - 此实例被添加到父标记的可用选项集合。
  • SelectItem 的数组 - 此实例集合按下标升序顺序被添加到父组件的可用选项集合。
  • SelectItem Collection - 此实例集合按其上迭代器提供的顺序被添加到父组件的可用选项集合。
  • Map - 此对象的键(转换为 String 后)假定为标签,而此对象的值(转换为 String 后)假定为 SelectItem 实例的值,可以动态构造这些实例,并按这些键上迭代器提供的顺序,将其添加到父组件的可用选项集合。
英文文档:

UISelectItems is a component that may be nested inside a UISelectMany or UISelectOne component, and causes the addition of one or more SelectItem instances to the list of available options in the parent component. The value of this component (set either directly, or acquired indirectly a ValueExpression, can be of any of the following types:

  • Single instance of SelectItem - This instance is added to the set of available options for the parent tag.
  • Array of SelectItem - This set of instances is added to the set of available options for the parent component, in ascending subscript order.
  • Collection of SelectItem - This set of instances is added to the set of available options for the parent component, in the order provided by an iterator over them.
  • Map - The keys of this object (once converted to Strings) are assumed to be labels, and the values of this object (once converted to Strings) are assumed to be values, of SelectItem instances that will be constructed dynamically and added to the set of available options for the parent component, in the order provided by an iterator over the keys.


Field Summary
static String
static String
 
Fields inherited from class javax.faces.component.UIComponent
 
Constructor Summary
 
Method Summary
 String
 Object
 void
 Object
 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 UISelectItems()

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

英文文档:

UISelectItems

public UISelectItems()

Create a new UISelectItems 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 Object getValue()

返回 UISelectItemsvalue 属性。

英文文档:

getValue

public Object getValue()

Returns the value property of the UISelectItems.


public void setValue(Object value)

设置 UISelectItemsvalue 属性。

value 新值
英文文档:

setValue

public void setValue(Object value)

Sets the value property of the UISelectItems.

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