|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.faces.component Class UISelectOne
java.lang.Object javax.faces.component.UIComponent javax.faces.component.UIComponentBase javax.faces.component.UIOutput javax.faces.component.UIInput javax.faces.component.UISelectOne
- All Implemented Interfaces:
- EditableValueHolder, StateHolder, ValueHolder
- Direct Known Subclasses:
- HtmlSelectOneListbox, HtmlSelectOneMenu, HtmlSelectOneRadio
public class UISelectOne
- extends UIInput
UISelectOne 是表示用户从离散的可用选项集合中选择 0 或 1 个项的 UIComponent
。用户可以修改选定的值。(可选)通过将当前选定项存储为该组件的 value
属性,可以使用它预配置组件。
此组件通常呈现为一个选择框或一组单选按钮。
默认情况下,rendererType
属性被设置为 "javax.faces.Menu
"。可以调用 setRendererType()
方法更改此值。
UISelectOne is a UIComponent
that represents
the user's choice of zero or one items from among a discrete set of
available options. The user can modify the selected value. Optionally,
the component can be preconfigured with a currently selected item, by
storing it as the value
property of the component.
This component is generally rendered as a select box or a group of radio buttons.
By default, the rendererType
property is set to
"javax.faces.Menu
". This value can be changed by
calling the setRendererType()
method.
Field Summary | |
---|---|
static String |
COMPONENT_FAMILY
The standard component family for this component. |
static String |
COMPONENT_TYPE
The standard component type for this component. |
static String |
INVALID_MESSAGE_ID
The message identifier of the FacesMessage to be created if
a value not matching the available options is specified. |
Fields inherited from class javax.faces.component.UIInput |
---|
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID |
Fields inherited from class javax.faces.component.UIComponent |
---|
bindings |
Constructor Summary | |
---|---|
UISelectOne()
Create a new UISelectOne instance with default property
values. |
Method Summary | |
---|---|
String |
getFamily()
Return the identifier of the component family to which this component belongs. |
protected void |
validateValue(FacesContext context,
Object value)
In addition to the standard validation behavior inherited from UIInput , ensure that any specified value is equal to one of
the available options. |
Methods inherited from class javax.faces.component.UIOutput |
---|
getConverter, getLocalValue, getValue, setConverter |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding |
Methods inherited from class javax.faces.component.UIComponent |
---|
encodeAll, getContainerClientId, getValueExpression, setValueExpression |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.faces.component.ValueHolder |
---|
getConverter, getLocalValue, getValue, setConverter |
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
英文文档:
INVALID_MESSAGE_ID
public static final String INVALID_MESSAGE_ID
The message identifier of the
FacesMessage
to be created if a value not matching the available options is specified.- See Also:
- Constant Field Values
Constructor Detail |
---|
public
UISelectOne()
使用默认属性值创建新的 UISelectOne
实例。
UISelectOne
public UISelectOne()
Create a new
UISelectOne
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 appropriateRenderer
for this component instance.
protected void
validateValue(FacesContext context, Object value)
除继承自 UIInput
的标准验证行为外,还确保任何指定的值等于可用选项之一。在比较每个选项前,将根据 Expression 语言强制匹配规则强制匹配选项值类型与此组件值的类型。如果指定的值不等于任何选项,则将错误消息加入队列并将 valid
属性设置为 false
。
context |
当前请求的 FacesContext |
value | 要测试成员关系的转换值。 |
Throws | NullPointerException:
如果 context 为 null |
validateValue
protected void validateValue(FacesContext context, Object value)
In addition to the standard validation behavior inherited from
UIInput
, ensure that any specified value is equal to one of the available options. Before comparing each option, coerce the option value type to the type of this component's value following the Expression Language coercion rules. If the specified value is not equal to any of the options, enqueue an error message and set thevalid
property tofalse
.- Overrides:
validateValue
in classUIInput
- Parameters:
context
- TheFacesContext
for the current requestvalue
- The converted value to test for membership.- Throws:
NullPointerException
- ifcontext
isnull
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!