|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.faces.component Class UIForm
java.lang.Object javax.faces.component.UIComponent javax.faces.component.UIComponentBase javax.faces.component.UIForm
- All Implemented Interfaces:
- NamingContainer, StateHolder
- Direct Known Subclasses:
- HtmlForm
public class UIForm
- extends UIComponentBase
- implements NamingContainer
UIForm 是一个 UIComponent
,表示要提供给用户的输入表单,而其子组件表示(除其他功能之外)提交表单时要包含的输入字段。
默认情况下,rendererType
属性必须设置为 "javax.faces.Form
"。可以调用 setRendererType()
方法更改此值。
UIForm is a UIComponent
that represents an
input form to be presented to the user, and whose child components represent
(among other things) the input fields to be included when the form is
submitted.
By default, the rendererType
property must be set to
"javax.faces.Form
". 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. |
Fields inherited from class javax.faces.component.UIComponent |
---|
bindings |
Fields inherited from interface javax.faces.component.NamingContainer |
---|
SEPARATOR_CHAR |
Constructor Summary | |
---|---|
UIForm()
Create a new UIForm instance with default property
values. |
Method Summary | |
---|---|
String |
getContainerClientId(FacesContext context)
Override the UIComponent.getContainerClientId(javax.faces.context.FacesContext) to allow
users to disable this form from prepending its clientId to
its descendent's clientIds depending on the value of
this form's isPrependId() property. |
String |
getFamily()
Return the identifier of the component family to which this component belongs. |
boolean |
isPrependId()
|
boolean |
isSubmitted()
Returns the current value of the submitted
property. |
void |
processDecodes(FacesContext context)
Override UIComponent.processDecodes(javax.faces.context.FacesContext) to ensure that the
form is decoded before its children. |
void |
processUpdates(FacesContext context)
Override UIComponent.processUpdates(javax.faces.context.FacesContext) to ensure that the
children of this UIForm instance are only processed
if isSubmitted() returns true . |
void |
processValidators(FacesContext context)
Override UIComponent.processValidators(javax.faces.context.FacesContext) to ensure that
the children of this UIForm instance are only
processed if isSubmitted() returns true . |
void |
setPrependId(boolean prependId)
|
void |
setSubmitted(boolean submitted)
If this UIForm instance (as
opposed to other forms in the page) is experiencing a submit
during this request processing lifecycle, this method must be
called, with true as the argument, during the UIComponent.decode(javax.faces.context.FacesContext) for this UIForm instance. |
Methods inherited from class javax.faces.component.UIComponent |
---|
encodeAll, getValueExpression, setValueExpression |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
UIForm()
使用默认属性值创建新的 UIForm
实例。
UIForm
public UIForm()
Create a new
UIForm
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.- Specified by:
getFamily
in classUIComponent
public boolean
isSubmitted()
返回 submitted
属性的当前值。默认值为 false
。有关详细信息,请参见 #setSubmitted
。
isSubmitted
public boolean isSubmitted()
Returns the current value of the
submitted
property. The default value isfalse
. SeesetSubmitted(boolean)
for details.
public void
setSubmitted(boolean submitted)
如果在此请求处理生命周期中此 UIForm
实例(与页面中的其他表单相对)遇到提交操作,则必须在此 UIForm
实例的 UIComponent#decode
期间,使用 true
作为参数调用此方法。如果此 UIForm
实例没有遇到提交操作,则在此 UIForm
实例的 UIComponent#decode
期间,必须使用 false
作为参数调用此方法。
UIForm
的已提交属性的值不得作为其状态的一部分保存。
setSubmitted
public void setSubmitted(boolean submitted)
If this
UIForm
instance (as opposed to other forms in the page) is experiencing a submit during this request processing lifecycle, this method must be called, withtrue
as the argument, during theUIComponent.decode(javax.faces.context.FacesContext)
for thisUIForm
instance. If thisUIForm
instance is not experiencing a submit, this method must be called, withfalse
as the argument, during theUIComponent.decode(javax.faces.context.FacesContext)
for thisUIForm
instance.The value of a
UIForm
's submitted property must not be saved as part of its state.
public boolean
isPrependId()
英文文档:
isPrependId
public boolean isPrependId()
public void
setPrependId(boolean prependId)
英文文档:
setPrependId
public void setPrependId(boolean prependId)
public void
processDecodes(FacesContext context)
重写 UIComponent#processDecodes
以确保表单在其子表单之前解码。使 submitted
属性得到正确设置是很有必要的。
Throws | NullPointerException:
NullPointerException
NullPointerException
如果 context 为 null |
processDecodes
public void processDecodes(FacesContext context)
Override
UIComponent.processDecodes(javax.faces.context.FacesContext)
to ensure that the form is decoded before its children. This is necessary to allow thesubmitted
property to be correctly set.- Overrides:
processDecodes
in classUIComponentBase
- Parameters:
context
-FacesContext
for the request we are processing- Throws:
NullPointerException
- ifcontext
isnull
public void
processValidators(FacesContext context)
重写 UIComponent#processValidators
以确保只有在 #isSubmitted
返回 true
的情况下,处理此 UIForm
实例的子实例。
Throws | NullPointerException:
NullPointerException
NullPointerException
如果 context 为 null |
processValidators
public void processValidators(FacesContext context)
Override
UIComponent.processValidators(javax.faces.context.FacesContext)
to ensure that the children of thisUIForm
instance are only processed ifisSubmitted()
returnstrue
.- Overrides:
processValidators
in classUIComponentBase
- Parameters:
context
-FacesContext
for the request we are processing- Throws:
NullPointerException
- ifcontext
isnull
public void
processUpdates(FacesContext context)
重写 UIComponent#processUpdates
以确保只有在 #isSubmitted
返回 true
的情况下,处理此 UIForm
实例的子实例。
Throws | NullPointerException:
NullPointerException
NullPointerException
如果 context 为 null |
processUpdates
public void processUpdates(FacesContext context)
Override
UIComponent.processUpdates(javax.faces.context.FacesContext)
to ensure that the children of thisUIForm
instance are only processed ifisSubmitted()
returnstrue
.- Overrides:
processUpdates
in classUIComponentBase
- Parameters:
context
-FacesContext
for the request we are processing- Throws:
NullPointerException
- ifcontext
isnull
public String
getContainerClientId(FacesContext context)
重写 UIComponent#getContainerClientId
,以允许用户根据此表单的 #isPrependId
属性的值,禁止此表单将其 clientId
放到其后代的 clientIds
前面。
getContainerClientId
public String getContainerClientId(FacesContext context)
Override the
UIComponent.getContainerClientId(javax.faces.context.FacesContext)
to allow users to disable this form from prepending itsclientId
to its descendent'sclientIds
depending on the value of this form'sisPrependId()
property.- Overrides:
getContainerClientId
in classUIComponent
|
|||||||||
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 : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!