|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UIForm
com.sun.webui.jsf.component.Form
public class Form
The Form component is used to create a form element.
Nested Class Summary | |
---|---|
static class |
Form.VirtualFormDescriptor
|
Field Summary | |
---|---|
static char |
ID_WILD_CHAR
|
Fields inherited from class javax.faces.component.UIForm |
---|
COMPONENT_FAMILY, COMPONENT_TYPE |
Fields inherited from interface javax.faces.component.NamingContainer |
---|
SEPARATOR_CHAR |
Constructor Summary | |
---|---|
Form()
Default constructor. |
Method Summary | |
---|---|
void |
addInternalVirtualForm(Form.VirtualFormDescriptor descriptor)
Add a VirtualFormDescriptor to the internal virtual forms. |
void |
discardSubmittedValue(javax.faces.component.EditableValueHolder inputField)
Ensure that the supplied EditableValueHolder component
will discard (rather than retain) its submitted value when a virtual
form is submitted in which the component does not participate. |
void |
discardSubmittedValues(java.lang.String virtualFormName)
Ensure that the participants in the supplied virtual form will discard (rather than retain) their submitted values when a different virtual form is submitted. |
javax.faces.component.UIComponent |
findComponentById(java.lang.String id)
Given a bare, partially qualified, or fully qualified id, find the component. |
static boolean |
fullyQualifiedIdMatchesPattern(java.lang.String fqId,
java.lang.String pattern)
Determine if the fully qualified id provided matches the supplied pattern. |
static Form.VirtualFormDescriptor[] |
generateVirtualForms(java.lang.String configStr)
Generate an array of VirtualFormDescriptor s based on a virtual form
configuration String . |
static java.lang.String |
generateVirtualFormsConfig(Form.VirtualFormDescriptor[] descriptors)
Generate a virtual form configuration String based on an
array of VirtualFormDescriptor s. |
java.lang.String |
getEnctype()
|
java.lang.String |
getFamily()
Return the family for this component. |
static java.lang.String |
getFullyQualifiedId(javax.faces.component.UIComponent component)
Obtain the virtual form compatible fully-qualified id for the supplied component. |
Form.VirtualFormDescriptor[] |
getInternalVirtualForms()
|
java.lang.String |
getOnClick()
|
java.lang.String |
getOnDblClick()
|
java.lang.String |
getOnKeyDown()
|
java.lang.String |
getOnKeyPress()
|
java.lang.String |
getOnKeyUp()
|
java.lang.String |
getOnMouseDown()
|
java.lang.String |
getOnMouseMove()
|
java.lang.String |
getOnMouseOut()
|
java.lang.String |
getOnMouseOver()
|
java.lang.String |
getOnMouseUp()
|
java.lang.String |
getOnReset()
|
java.lang.String |
getOnSubmit()
|
java.lang.String |
getStyle()
|
java.lang.String |
getStyleClass()
|
java.lang.String |
getTarget()
|
Form.VirtualFormDescriptor |
getVirtualFormComponentSubmits(java.lang.String id)
Get the virtual form submitted by the component whose id is provided or null if the component does not submit a virtual form. |
Form.VirtualFormDescriptor[] |
getVirtualForms()
|
java.lang.String |
getVirtualFormsConfig()
|
boolean |
isAutoComplete()
|
static boolean |
isValidFullyQualifiedId(java.lang.String id)
Determine if the id provided is non-null and exhibits the traits of a fully qualified id. |
boolean |
isVisible()
|
void |
processDecodes(javax.faces.context.FacesContext context)
Override UIForm.processDecodes(FacesContext) to ensure
correct virtual form processing. |
void |
queueEvent(javax.faces.event.FacesEvent event)
|
void |
restoreNonParticipatingSubmittedValues()
Restore the submitted values erased by the virtual form mechanism where appropriate. |
void |
restoreState(javax.faces.context.FacesContext _context,
java.lang.Object _state)
Restore the state of this component. |
java.lang.Object |
saveState(javax.faces.context.FacesContext _context)
Save the state of this component. |
void |
setAutoComplete(boolean autoComplete)
Use this non-XHTML compliant boolean attribute to turn off autocompletion feature of Internet Explorer and Firefox browsers. |
void |
setEnctype(java.lang.String enctype)
Use this attribute to set the content-type of the HTTP request generated by this form. |
void |
setId(java.lang.String id)
The component identifier for this component. |
void |
setInternalVirtualForms(Form.VirtualFormDescriptor[] internalVirtualForms)
The virtual forms used "internally" by components (such as Table). |
void |
setOnClick(java.lang.String onClick)
Scripting code executed when a mouse click occurs over this component. |
void |
setOnDblClick(java.lang.String onDblClick)
Scripting code executed when a mouse double click occurs over this component. |
void |
setOnKeyDown(java.lang.String onKeyDown)
Scripting code executed when the user presses down on a key while the component has focus. |
void |
setOnKeyPress(java.lang.String onKeyPress)
Scripting code executed when the user presses and releases a key while the component has focus. |
void |
setOnKeyUp(java.lang.String onKeyUp)
Scripting code executed when the user releases a key while the component has focus. |
void |
setOnMouseDown(java.lang.String onMouseDown)
Scripting code executed when the user presses a mouse button while the mouse pointer is on the component. |
void |
setOnMouseMove(java.lang.String onMouseMove)
Scripting code executed when the user moves the mouse pointer while over the component. |
void |
setOnMouseOut(java.lang.String onMouseOut)
Scripting code executed when a mouse out movement occurs over this component. |
void |
setOnMouseOver(java.lang.String onMouseOver)
Scripting code executed when the user moves the mouse pointer into the boundary of this component. |
void |
setOnMouseUp(java.lang.String onMouseUp)
Scripting code executed when the user releases a mouse button while the mouse pointer is on the component. |
void |
setOnReset(java.lang.String onReset)
Scripting code executed when this form is reset. |
void |
setOnSubmit(java.lang.String onSubmit)
Scripting code executed when this form is submitted. |
void |
setRendered(boolean rendered)
Use the rendered attribute to indicate whether the HTML code for the component should be included in the rendered HTML page. |
void |
setStyle(java.lang.String style)
CSS style(s) to be applied to the outermost HTML element when this component is rendered. |
void |
setStyleClass(java.lang.String styleClass)
CSS style class(es) to be applied to the outermost HTML element when this component is rendered. |
void |
setSubmittedVirtualForm(Form.VirtualFormDescriptor vfd)
|
void |
setTarget(java.lang.String target)
Use this attribute to set the target of the XHTML form tag. |
void |
setVirtualForms(Form.VirtualFormDescriptor[] vfds)
|
void |
setVirtualFormsConfig(java.lang.String configStr)
|
void |
setVisible(boolean visible)
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. |
Methods inherited from class javax.faces.component.UIForm |
---|
getContainerClientId, isPrependId, isSubmitted, processUpdates, processValidators, setPrependId, setSubmitted |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding, setValueExpression |
Methods inherited from class javax.faces.component.UIComponent |
---|
encodeAll |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char ID_WILD_CHAR
Constructor Detail |
---|
public Form()
Method Detail |
---|
public java.lang.String getFamily()
Return the family for this component.
getFamily
in class javax.faces.component.UIForm
public void processDecodes(javax.faces.context.FacesContext context)
Override UIForm.processDecodes(FacesContext)
to ensure
correct virtual form processing.
processDecodes
in class javax.faces.component.UIForm
context
- FacesContext
for the current request
java.lang.NullPointerException
- Thrown when context
is nullpublic void queueEvent(javax.faces.event.FacesEvent event)
queueEvent
in class javax.faces.component.UIComponentBase
public void setSubmittedVirtualForm(Form.VirtualFormDescriptor vfd)
public void setVirtualForms(Form.VirtualFormDescriptor[] vfds)
public void setVirtualFormsConfig(java.lang.String configStr)
public Form.VirtualFormDescriptor getVirtualFormComponentSubmits(java.lang.String id)
public javax.faces.component.UIComponent findComponentById(java.lang.String id)
findComponent
method, this method does recursively
search NamingContainers.
public static Form.VirtualFormDescriptor[] generateVirtualForms(java.lang.String configStr)
Generate an
array of VirtualFormDescriptor
s based on a virtual form
configuration String
.
public static java.lang.String generateVirtualFormsConfig(Form.VirtualFormDescriptor[] descriptors)
Generate a virtual form
configuration String
based on an
array of VirtualFormDescriptor
s.
public static java.lang.String getFullyQualifiedId(javax.faces.component.UIComponent component)
NamingContainer.SEPARATOR_CHAR
(representing the Form
itself), contains component ids of the
component's ancestors separated by NamingContainer.SEPARATOR_CHAR
,
and ends with the component's id.
public static boolean isValidFullyQualifiedId(java.lang.String id)
NamingContainer.SEPARATOR_CHAR
, not ending with that
character unless it is the only character, not ending in
Form.ID_WILD_CHAR
, and not containing spaces.
public static boolean fullyQualifiedIdMatchesPattern(java.lang.String fqId, java.lang.String pattern)
NamingContainer.SEPARATOR_CHAR
followed by the
Form.ID_WILD_CHAR
, in which case the children of the component
indicated by the pattern will be considered a match.
public void addInternalVirtualForm(Form.VirtualFormDescriptor descriptor)
VirtualFormDescriptor
to the internal virtual forms.
If an existing VirtualFormDescriptor object is found with the same name,
the object is replaced.
descriptor
- The VirtualFormDescriptor
to add.public void restoreNonParticipatingSubmittedValues()
Restore the submitted values erased by the virtual form mechanism
where appropriate.
This method is called in FormRenderer.renderStart
. It should
not be called by developer code.
Note: Restoring of submitted values works on
TableRowGroup
components, but does not work on the
standard faces data table component. This is because in
UIData.encodeBegin
, the table's per-row saved state is
typically discarded. The result is that upon
exiting FormRenderer.renderStart
, the submitted values will
be restored; however, they will subsequently be discarded.
Nonetheless, we still cache and restore those submitted values, in case
a third-party component extends
UIData
and, unlike UIData
, does not discard
its saved state during rendering.
public void discardSubmittedValue(javax.faces.component.EditableValueHolder inputField)
Ensure that the supplied EditableValueHolder
component
will discard (rather than retain) its submitted value when a virtual
form is submitted in which the component does not participate.
inputField
- An EditableValueHolder
component that is
not a participant in the virtual form that was submitted
on this request.
java.lang.IllegalArgumentException
- if inputField is null.
java.lang.IllegalArgumentException
- if a virtual form has been
submitted and the supplied inputField participates in it.public void discardSubmittedValues(java.lang.String virtualFormName)
Ensure that the participants in the supplied virtual form will discard (rather than retain) their submitted values when a different virtual form is submitted.
virtualFormName
- The name of a virtual form on this page which
has not been submitted.
java.lang.IllegalArgumentException
- if no virtual form exists with the
supplied name.
java.lang.IllegalArgumentException
- if the supplied virtual form has been
submitted on this request.public java.lang.String getEnctype()
public void setId(java.lang.String id)
setId
in class javax.faces.component.UIComponentBase
public void setRendered(boolean rendered)
setRendered
in class javax.faces.component.UIComponentBase
public boolean isAutoComplete()
public void setAutoComplete(boolean autoComplete)
Use this non-XHTML compliant boolean attribute to turn off autocompletion feature of Internet Explorer and Firefox browsers. Set to "false" to turn off completion. The default is "true".
isAutoComplete()
public void setEnctype(java.lang.String enctype)
Use this attribute to set the content-type of the HTTP request generated by this form. You do not normally need to set this attribute. Its default value is application/x-www-form-urlencoded. If there is an upload tag inside the form, the upload tag will modify the form's enctype attribute to multipart/form-data.
getEnctype()
public Form.VirtualFormDescriptor[] getInternalVirtualForms()
public void setInternalVirtualForms(Form.VirtualFormDescriptor[] internalVirtualForms)
The virtual forms used "internally" by components (such as Table). Component authors can manipulate this set of virtual forms independent of the set exposed to developers. This set is only consulted after the set exposed to developers is consulted. A participating or submitting id can end in ":*" to indicate descendants. For example, table1:* can be used as a participating or submitting id to indicate all the descendants of table1.
getInternalVirtualForms()
public java.lang.String getOnClick()
public void setOnClick(java.lang.String onClick)
Scripting code executed when a mouse click occurs over this component.
getOnClick()
public java.lang.String getOnDblClick()
public void setOnDblClick(java.lang.String onDblClick)
Scripting code executed when a mouse double click occurs over this component.
getOnDblClick()
public java.lang.String getOnKeyDown()
public void setOnKeyDown(java.lang.String onKeyDown)
Scripting code executed when the user presses down on a key while the component has focus.
getOnKeyDown()
public java.lang.String getOnKeyPress()
public void setOnKeyPress(java.lang.String onKeyPress)
Scripting code executed when the user presses and releases a key while the component has focus.
getOnKeyPress()
public java.lang.String getOnKeyUp()
public void setOnKeyUp(java.lang.String onKeyUp)
Scripting code executed when the user releases a key while the component has focus.
getOnKeyUp()
public java.lang.String getOnMouseDown()
public void setOnMouseDown(java.lang.String onMouseDown)
Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
getOnMouseDown()
public java.lang.String getOnMouseMove()
public void setOnMouseMove(java.lang.String onMouseMove)
Scripting code executed when the user moves the mouse pointer while over the component.
getOnMouseMove()
public java.lang.String getOnMouseOut()
public void setOnMouseOut(java.lang.String onMouseOut)
Scripting code executed when a mouse out movement occurs over this component.
getOnMouseOut()
public java.lang.String getOnMouseOver()
public void setOnMouseOver(java.lang.String onMouseOver)
Scripting code executed when the user moves the mouse pointer into the boundary of this component.
getOnMouseOver()
public java.lang.String getOnMouseUp()
public void setOnMouseUp(java.lang.String onMouseUp)
Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
getOnMouseUp()
public java.lang.String getOnReset()
public void setOnReset(java.lang.String onReset)
Scripting code executed when this form is reset.
getOnReset()
public java.lang.String getOnSubmit()
public void setOnSubmit(java.lang.String onSubmit)
Scripting code executed when this form is submitted.
getOnSubmit()
public java.lang.String getStyle()
public void setStyle(java.lang.String style)
CSS style(s) to be applied to the outermost HTML element when this component is rendered.
getStyle()
public java.lang.String getStyleClass()
public void setStyleClass(java.lang.String styleClass)
CSS style class(es) to be applied to the outermost HTML element when this component is rendered.
getStyleClass()
public java.lang.String getTarget()
public void setTarget(java.lang.String target)
Use this attribute to set the target of the XHTML form tag.
getTarget()
public Form.VirtualFormDescriptor[] getVirtualForms()
public java.lang.String getVirtualFormsConfig()
public boolean isVisible()
public void setVisible(boolean visible)
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
isVisible()
public void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
Restore the state of this component.
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class javax.faces.component.UIComponentBase
public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.
saveState
in interface javax.faces.component.StateHolder
saveState
in class javax.faces.component.UIComponentBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |