Top Description Inners Fields Constructors Methods
javax.faces.component

public Class UIForm

extends UIComponentBase
implements NamingContainer, UniqueIdVendor
Class Inheritance
All Implemented Interfaces
javax.faces.component.UniqueIdVendor, javax.faces.component.NamingContainer
Known Direct Subclasses
javax.faces.component.html.HtmlForm
Static Imports
com.sun.faces.util.Util.coalesce, javax.faces.component.UIViewRoot.UNIQUE_ID_PREFIX, javax.faces.component.visit.VisitResult.COMPLETE

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum
UIForm.PropertyKeys

Properties that are tracked by state saving.

Field Summary

Modifier and TypeField and Description
public static final String
COMPONENT_FAMILY

The standard component family for this component.

public static final String
COMPONENT_TYPE

The standard component type for this component.

Constructor Summary

AccessConstructor and Description
public
UIForm()

Create a new UIForm instance with default property values.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

a unique-id in this component-container
createUniqueId
(FacesContext
FacesContext
context
,
String
an optional seed value - e.g. based on the position of the component in the VDL-template
seed
)

Implements javax.faces.component.UniqueIdVendor.createUniqueId.

Generate an identifier for a component.

public String
getContainerClientId(FacesContext
the Faces context.
context
)

Overrides javax.faces.component.UIComponent.getContainerClientId.

Override the UIComponent#getContainerClientId 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.

public String
getFamily()

Implements abstract javax.faces.component.UIComponent.getFamily.

Return the identifier of the component family to which this component belongs.

private Integer
public boolean

Returns:

true if it is, false otherwise.
isPrependId
()

Is the id prepended.

public boolean

Returns:

true if the form was submitted, false otherwise.
isSubmitted
()

Returns the current value of the submitted property.

public void
processDecodes(FacesContext
FacesContext for the request we are processing
context
)

Overrides javax.faces.component.UIComponentBase.processDecodes.

Override UIComponent#processDecodes to ensure that the form is decoded before its children.

public void
processUpdates(FacesContext
FacesContext for the request we are processing
context
)

Overrides javax.faces.component.UIComponentBase.processUpdates.

Override UIComponent#processUpdates to ensure that the children of this UIForm instance are only processed if isSubmitted returns true.

public void
processValidators(FacesContext
FacesContext for the request we are processing
context
)

Overrides javax.faces.component.UIComponentBase.processValidators.

Override UIComponent#processValidators to ensure that the children of this UIForm instance are only processed if isSubmitted returns true.

private void
public void
setPrependId(boolean prependId)

public void
setSubmitted(boolean
the new value of the submitted flag.
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 for this UIForm instance.

public boolean
visitTree(VisitContext
the VisitContext for this visit
context
,
VisitCallback
the VisitCallback instance whose visit method will be called for each node visited.
callback
)

Overrides javax.faces.component.UIComponent.visitTree.

Perform a tree visit starting at this node in the tree.

Inherited from javax.faces.component.UIComponentBase:
addClientBehavioraddFacesListenerbroadcastclearInitialStatedecodeencodeBeginencodeChildrenencodeEndfindComponentgetAttributesgetChildCountgetChildrengetClientBehaviorsgetClientIdgetDefaultEventNamegetDescriptorMapgetEventNamesgetFacesContextgetFacesListenersgetFacetgetFacetCountgetFacetsgetFacetsAndChildrengetIdgetListenersForEventClassgetParentgetPassThroughAttributesgetRenderergetRendererTypegetRendersChildrengetValueBindinginvokeOnComponentisRenderedisTransientmarkInitialStateprocessRestoreStateprocessSaveStatequeueEventremoveFacesListenerrestoreAttachedStaterestoreStatesaveAttachedStatesaveStatesetIdsetParentsetRenderedsetRendererTypesetTransientsetValueBindingsubscribeToEventunsubscribeFromEvent

Field Detail

COMPONENT_FAMILYback to summary
public static final String COMPONENT_FAMILY

The standard component family for this component.

COMPONENT_TYPEback to summary
public static final String COMPONENT_TYPE

The standard component type for this component.

Constructor Detail

UIFormback to summary
public UIForm()

Create a new UIForm instance with default property values.

Method Detail

createUniqueIdback to summary
public String createUniqueId(FacesContext context, String seed)

Implements javax.faces.component.UniqueIdVendor.createUniqueId.

Generate an identifier for a component. The identifier will be prefixed with UNIQUE_ID_PREFIX, and will be unique within this component-container. Optionally, a unique seed value can be supplied by component creators which should be included in the generated unique id.

If the prependId property has the value false, this method must call createUniqueId on the next ancestor UniqueIdVendor.

Parameters
context:FacesContext

FacesContext

seed:String

an optional seed value - e.g. based on the position of the component in the VDL-template

Returns:String

a unique-id in this component-container

Annotations
@Override
getContainerClientIdback to summary
public String getContainerClientId(FacesContext context)

Overrides javax.faces.component.UIComponent.getContainerClientId.

Override the UIComponent#getContainerClientId 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.

Parameters
context:FacesContext

Doc from javax.faces.component.UIComponent.getContainerClientId.

the Faces context.

Returns:String

Doc from javax.faces.component.UIComponent.getContainerClientId.

the container client id.

Annotations
@Override
getFamilyback to summary
public String getFamily()

Implements abstract javax.faces.component.UIComponent.getFamily.

Doc from javax.faces.component.UIComponent.getFamily.

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. Note this method should NOT return null

Returns:String

the component family (not null).

Annotations
@Override
getLastIdback to summary
private Integer getLastId()
isPrependIdback to summary
public boolean isPrependId()

Is the id prepended.

Returns:boolean

true if it is, false otherwise.

isSubmittedback to summary
public boolean isSubmitted()

Returns the current value of the submitted property. The default value is false. See setSubmitted for details.

This property must be kept as a transient property using the UIComponent#getTransientStateHelper.

Returns:boolean

true if the form was submitted, false otherwise.

processDecodesback to summary
public void processDecodes(FacesContext context)

Overrides javax.faces.component.UIComponentBase.processDecodes.

Override UIComponent#processDecodes to ensure that the form is decoded before its children. This is necessary to allow the submitted property to be correctly set.

Parameters
context:FacesContext

Doc from javax.faces.component.UIComponent.processDecodes.

FacesContext for the request we are processing

Annotations
@Override
Exceptions
NullPointerException:
if context is null
processUpdatesback to summary
public void processUpdates(FacesContext context)

Overrides javax.faces.component.UIComponentBase.processUpdates.

Override UIComponent#processUpdates to ensure that the children of this UIForm instance are only processed if isSubmitted returns true.

Parameters
context:FacesContext

Doc from javax.faces.component.UIComponent.processUpdates.

FacesContext for the request we are processing

Annotations
@Override
Exceptions
NullPointerException:
if context is null
processValidatorsback to summary
public void processValidators(FacesContext context)

Overrides javax.faces.component.UIComponentBase.processValidators.

Override UIComponent#processValidators to ensure that the children of this UIForm instance are only processed if isSubmitted returns true.

Parameters
context:FacesContext

Doc from javax.faces.component.UIComponent.processValidators.

FacesContext for the request we are processing

Annotations
@Override
Exceptions
NullPointerException:
if context is null
See Also
javax.faces.event.PreValidateEvent, javax.faces.event.PostValidateEvent
setLastIdback to summary
private void setLastId(Integer lastId)
setPrependIdback to summary
public void setPrependId(boolean prependId)
setSubmittedback to summary
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 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 for this UIForm instance.

The value of a UIForm's submitted property must not be saved as part of its state.

This property must be kept as a transient property using the UIComponent#getTransientStateHelper.

Parameters
submitted:boolean

the new value of the submitted flag.

visitTreeback to summary
public boolean visitTree(VisitContext context, VisitCallback callback)

Overrides javax.faces.component.UIComponent.visitTree.

Doc from javax.faces.component.UIComponent.visitTree.

Perform a tree visit starting at this node in the tree.

UIComponent.visitTree() implementations do not invoke the VisitCallback directly, but instead call VisitContext#invokeVisitCallback to invoke the callback. This allows VisitContext implementations to provide optimized tree traversals, for example by only calling the VisitCallback for a subset of components.

UIComponent.visitTree() implementations must call UIComponent.pushComponentToEL() before performing the visit and UIComponent.popComponentFromEL() after the visit.

Parameters
context:VisitContext

the VisitContext for this visit

callback:VisitCallback

the VisitCallback instance whose visit method will be called for each node visited.

Returns:boolean

component implementations may return true to indicate that the tree visit is complete (eg. all components that need to be visited have been visited). This results in the tree visit being short-circuited such that no more components are visited.

Annotations
@Override
See Also
UIComponent#visitTree
javax.faces.component back to summary

pack-priv final Enum UIForm.PropertyKeys

extends Enum<UIForm.PropertyKeys>
Class Inheritance

Properties that are tracked by state saving.

Field Summary

Modifier and TypeField and Description
public static final UIForm.PropertyKeys
public static final UIForm.PropertyKeys
prependId

The prependId flag.

public static final UIForm.PropertyKeys

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static UIForm.PropertyKeys
public static UIForm.PropertyKeys[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

lastIdback to summary
public static final UIForm.PropertyKeys lastId

Last id vended by UIForm#createUniqueId(javax.faces.context.FacesContext, String).

prependIdback to summary
public static final UIForm.PropertyKeys prependId

The prependId flag.

submittedback to summary
public static final UIForm.PropertyKeys submitted

Constructor Detail

PropertyKeysback to summary
private PropertyKeys()

Method Detail

valueOfback to summary
public static UIForm.PropertyKeys valueOf(String name)
valuesback to summary
public static UIForm.PropertyKeys[] values()