org.apache.myfaces.custom.subform
Class AbstractSubForm

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.apache.myfaces.custom.subform.AbstractSubForm
All Implemented Interfaces:
java.util.EventListener, javax.faces.component.NamingContainer, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder
Direct Known Subclasses:
SubForm

public abstract class AbstractSubForm
extends javax.faces.component.UIComponentBase
implements javax.faces.component.NamingContainer

A SubForm which will allow for partial validation and model update.

A subform to an existing form. Inputs in this form will only be validated and updated, if a t:commandButton or t:commandLink has been clicked with an actionFor attribute which references the client-id of this subform. Optionally, the validation will trigger if a commandButton or commandLink embedded in this subform has been clicked, except if this command is a t:commandButton or t:commandLink with an actionFor attribute which doesn't reference the client-id of this subform.

Components will be validated and updated only if either a child-component of this form caused the submit of the form, or an extended commandLink or commandButton with the actionFor attribute set to the client-id of this component was used.

You can have several comma-separated entries in the actionFor-attribute - with this it's possible to validate and update more than one subForm at once.

Since:
1.1.7
Author:
Gerald Muellan, Martin Marinschek Date: 19.01.2006 Time: 13:58:18

Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String DEFAULT_RENDERER_TYPE
           
 
Fields inherited from class javax.faces.component.UIComponent
BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
AbstractSubForm()
           
 
Method Summary
 java.lang.String getFamily()
           
abstract  java.lang.Boolean getPreserveSubmittedValues()
          true|false - set to false if you submit other subforms and would like to have your subform reflecting any model update.
protected  boolean isEmptyList(javax.faces.context.FacesContext context)
           
protected  boolean isPartialEnabled(javax.faces.context.FacesContext context, javax.faces.event.PhaseId phaseId)
          Sets up information if this component is included in the group of components which are associated with the current action.
 boolean isSubmitted()
           
 void processDecodes(javax.faces.context.FacesContext context)
           
 void processUpdates(javax.faces.context.FacesContext context)
           
 void processValidators(javax.faces.context.FacesContext context)
           
 void queueEvent(javax.faces.event.FacesEvent event)
           
 void setSubmitted(boolean submitted)
           
 
Methods inherited from class javax.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, initialStateMarked, invokeOnComponent, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, visitTree
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getValueExpression, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent
 
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 java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

DEFAULT_RENDERER_TYPE

public static final java.lang.String DEFAULT_RENDERER_TYPE
See Also:
Constant Field Values

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values
Constructor Detail

AbstractSubForm

public AbstractSubForm()
Method Detail

getFamily

public java.lang.String getFamily()
Specified by:
getFamily in class javax.faces.component.UIComponent

isSubmitted

public boolean isSubmitted()

setSubmitted

public void setSubmitted(boolean submitted)

getPreserveSubmittedValues

public abstract java.lang.Boolean getPreserveSubmittedValues()
true|false - set to false if you submit other subforms and would like to have your subform reflecting any model update. Default: true

Returns:

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
Overrides:
processDecodes in class javax.faces.component.UIComponentBase

processValidators

public void processValidators(javax.faces.context.FacesContext context)
Overrides:
processValidators in class javax.faces.component.UIComponentBase

processUpdates

public void processUpdates(javax.faces.context.FacesContext context)
Overrides:
processUpdates in class javax.faces.component.UIComponentBase

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Overrides:
queueEvent in class javax.faces.component.UIComponentBase

isEmptyList

protected boolean isEmptyList(javax.faces.context.FacesContext context)

isPartialEnabled

protected boolean isPartialEnabled(javax.faces.context.FacesContext context,
                                   javax.faces.event.PhaseId phaseId)
Sets up information if this component is included in the group of components which are associated with the current action.

Parameters:
context -
Returns:
true if there has been a change by this setup which has to be undone after the phase finishes.


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.