com.sun.rave.web.ui.component
Class Form

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byjavax.faces.component.UIForm
              extended bycom.sun.rave.web.ui.component.FormBase
                  extended bycom.sun.rave.web.ui.component.Form
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder

public class Form
extends FormBase

Component that represents an input form.


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()
           
 
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 VirtualFormDescriptors 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 VirtualFormDescriptors.
 java.lang.String getEnctype()
          Use this attribute to set the content-type of the HTTP request generated by this form.
static java.lang.String getFullyQualifiedId(javax.faces.component.UIComponent component)
          Obtain the virtual form compatible fully-qualified id for the supplied component.
 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.
static boolean isValidFullyQualifiedId(java.lang.String id)
          Determine if the id provided is non-null and exhibits the traits of a fully qualified id.
 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 setSubmittedVirtualForm(Form.VirtualFormDescriptor vfd)
           
 void setVirtualForms(Form.VirtualFormDescriptor[] vfds)
          The virtual forms within this literal form, represented as an array of Form.VirtualFormDescriptor objects.
 void setVirtualFormsConfig(java.lang.String configStr)
          The configuration of the virtual forms within this literal form, represented as a String.
 
Methods inherited from class com.sun.rave.web.ui.component.FormBase
getFamily, getInternalVirtualForms, getOnClick, getOnDblClick, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnReset, getOnSubmit, getStyle, getStyleClass, getTarget, getVirtualForms, getVirtualFormsConfig, isAutoComplete, isVisible, restoreState, saveState, setAutoComplete, setEnctype, setInternalVirtualForms, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnReset, setOnSubmit, setStyle, setStyleClass, setTarget, setVisible
 
Methods inherited from class javax.faces.component.UIForm
isSubmitted, processUpdates, processValidators, setSubmitted
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_WILD_CHAR

public static final char ID_WILD_CHAR
See Also:
Constant Field Values
Constructor Detail

Form

public Form()
Method Detail

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)

Override UIForm.processDecodes(FacesContext) to ensure correct virtual form processing.

Parameters:
context - FacesContext for the current request
Throws:
java.lang.NullPointerException - Thrown when context is null

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)

setSubmittedVirtualForm

public void setSubmittedVirtualForm(Form.VirtualFormDescriptor vfd)

setVirtualForms

public void setVirtualForms(Form.VirtualFormDescriptor[] vfds)
Description copied from class: FormBase

The virtual forms within this literal form, represented as an array of Form.VirtualFormDescriptor objects. This property and the "virtualFormsConfig" property are automatically kept in-sync.

Overrides:
setVirtualForms in class FormBase
See Also:
FormBase.getVirtualForms()

setVirtualFormsConfig

public void setVirtualFormsConfig(java.lang.String configStr)
Description copied from class: FormBase

The configuration of the virtual forms within this literal form, represented as a String. Each virtual form is described by three parts, separated with pipe ("|") characters: the virtual form name, a space-separated list of component ids that participate in the virtual form, and a space-separated list of component ids that submit the virtual form. Multiple such virtual form "descriptors" are separated by commas. The component ids may be qualified (for instance, "table1:tableRowGroup1:tableColumn1:textField1").

Overrides:
setVirtualFormsConfig in class FormBase
See Also:
FormBase.getVirtualFormsConfig()

getVirtualFormComponentSubmits

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


findComponentById

public javax.faces.component.UIComponent findComponentById(java.lang.String id)
Given a bare, partially qualified, or fully qualified id, find the component. Unlike the inherited findComponent method, this method does recursively search NamingContainers.


generateVirtualForms

public static Form.VirtualFormDescriptor[] generateVirtualForms(java.lang.String configStr)

Generate an array of VirtualFormDescriptors based on a virtual form configuration String.


generateVirtualFormsConfig

public static java.lang.String generateVirtualFormsConfig(Form.VirtualFormDescriptor[] descriptors)

Generate a virtual form configuration String based on an array of VirtualFormDescriptors.


getFullyQualifiedId

public static java.lang.String getFullyQualifiedId(javax.faces.component.UIComponent component)
Obtain the virtual form compatible fully-qualified id for the supplied component. A fully-qualified id begins with the 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.


isValidFullyQualifiedId

public static boolean isValidFullyQualifiedId(java.lang.String id)
Determine if the id provided is non-null and exhibits the traits of a fully qualified id. This includes beginning with 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.


fullyQualifiedIdMatchesPattern

public static boolean fullyQualifiedIdMatchesPattern(java.lang.String fqId,
                                                     java.lang.String pattern)
Determine if the fully qualified id provided matches the supplied pattern. The pattern may be a bare, partially qualified, or fully qualified id. The pattern may also end with the 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.


addInternalVirtualForm

public void addInternalVirtualForm(Form.VirtualFormDescriptor descriptor)
Add a VirtualFormDescriptor to the internal virtual forms. If an existing VirtualFormDescriptor object is found with the same name, the object is replaced.

Parameters:
descriptor - The VirtualFormDescriptor to add.

restoreNonParticipatingSubmittedValues

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.


discardSubmittedValue

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.

Parameters:
inputField - An EditableValueHolder component that is not a participant in the virtual form that was submitted on this request.
Throws:
java.lang.IllegalArgumentException - if inputField is null.
java.lang.IllegalArgumentException - if a virtual form has been submitted and the supplied inputField participates in it.

discardSubmittedValues

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.

Parameters:
virtualFormName - The name of a virtual form on this page which has not been submitted.
Throws:
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.

getEnctype

public java.lang.String getEnctype()
Description copied from class: FormBase

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.

Overrides:
getEnctype in class FormBase