UIForm (Java EE 5)

Java EE API


javax.faces.component Class UIForm

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIForm
All Implemented Interfaces:
NamingContainer, StateHolder
Direct Known Subclasses:
HtmlForm

public class UIForm
extends UIComponentBase
implements NamingContainer

Implements: NamingContainer
Extended by: HtmlForm

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
static String
 
Fields inherited from class javax.faces.component.UIComponent
 
Fields inherited from interface javax.faces.component.NamingContainer
 
Constructor Summary
 
Method Summary
 String
 String
 boolean
 boolean
 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 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 appropriate Renderer for this component instance.

Specified by:
getFamily in class UIComponent

public boolean isSubmitted()

返回 submitted 属性的当前值。默认值为 false。有关详细信息,请参见 #setSubmitted

英文文档:

isSubmitted

public boolean isSubmitted()

Returns the current value of the submitted property. The default value is false. See setSubmitted(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, with true as the argument, during the UIComponent.decode(javax.faces.context.FacesContext) for this UIForm instance. If this UIForm instance is not experiencing a submit, this method must be called, with false as the argument, during the UIComponent.decode(javax.faces.context.FacesContext) for this UIForm 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 属性得到正确设置是很有必要的。

ThrowsNullPointerException: NullPointerException NullPointerException 如果 contextnull
英文文档:

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 the submitted property to be correctly set.

Overrides:
processDecodes in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void processValidators(FacesContext context)

重写 UIComponent#processValidators 以确保只有在 #isSubmitted 返回 true 的情况下,处理此 UIForm 实例的子实例。

ThrowsNullPointerException: NullPointerException NullPointerException 如果 contextnull
英文文档:

processValidators

public 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.

Overrides:
processValidators in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

public void processUpdates(FacesContext context)

重写 UIComponent#processUpdates 以确保只有在 #isSubmitted 返回 true 的情况下,处理此 UIForm 实例的子实例。

ThrowsNullPointerException: NullPointerException NullPointerException 如果 contextnull
英文文档:

processUpdates

public 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.

Overrides:
processUpdates in class UIComponentBase
Parameters:
context - FacesContext for the request we are processing
Throws:
NullPointerException - if context is null

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 its clientId to its descendent's clientIds depending on the value of this form's isPrependId() property.

Overrides:
getContainerClientId in class UIComponent


Submit a bug or feature

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

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

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