org.apache.myfaces.trinidad.component

## Class UIXSubform

- java.lang.Object
- - javax.faces.component.UIComponent
  - - org.apache.myfaces.trinidad.component.UIXComponent
    - - org.apache.myfaces.trinidad.component.UIXComponentBase
      - - org.apache.myfaces.trinidad.component.UIXSubform

- All Implemented Interfaces:
    javax.faces.component.NamingContainer, javax.faces.component.StateHolder
  Direct Known Subclasses:
    CoreSubform

      public class UIXSubform
      extends UIXComponentBase
      implements javax.faces.component.NamingContainer

  UIXSubform is the base abstraction for an independently submittable region of a page. The contents of a subform will only be validated (or otherwise processed) if a component inside of the subform is responsible for submitting the page. This allows for comparatively fine-grained control of which components will be validated and pushed into the model without the compromises of using entirely separate form elements. UIXSubform is a NamingContainer and therefore IDs can be reused between subforms.
  A UIXSubform is considered "submitted" if an event is queued by one of its children or facets for a phase later than "Apply Request Values" (that is, for later than decode()). The most common example is a (non-immediate) "command" component (like an <h:commandButton> or <tr:commandButton>). A UIXSubform will always allow the "Apply Request Values" phase to execute for its children, even when not "submitted", but when not "submitted", the "Process Validations" and "Update Model Values" phases will be skipped. This differs from an ordinary form component, which, when not submitted, does not (and cannot) run "Apply Request Values" either.
  In some scenarios, there may be buttons (or other components that submit the page) outside of the main content of a page. If this main content is in a UIXSubform, it could not be fully processed whenever those buttons are clicked, since those buttons aren't inside of the UIXSubform. To support this scenario, Apache Trinidad supports a "default" property on UIXSubform. A "default" subform behaves like any other subform in most respects, but if no subforms are "submitted" - if no subform has an appropriate event come from its children - then all "default" subforms act as if they are "submitted".

  #### Events:

  Type | Phases | Description
  --- | --- | ---
  `org.apache.myfaces.trinidad.event.AttributeChangeEvent` | Invoke Application Apply Request Values | Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `COMPONENT_FAMILY`
    `static String` | `COMPONENT_TYPE`
    `static PropertyKey` | `DEFAULT_KEY`
    `static PropertyKey` | `SUBMITTED_KEY`
    `static FacesBean.Type` | `TYPE`

    - ### Fields inherited from class org.apache.myfaces.trinidad.component.UIXComponentBase

      `BINDING_KEY, ID_KEY, RENDERED_KEY, RENDERER_TYPE_KEY, TRANSIENT_KEY`

    - ### Fields inherited from class javax.faces.component.UIComponent

      `bindings`

    - ### Fields inherited from interface javax.faces.component.NamingContainer

      `SEPARATOR_CHAR`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `UIXSubform()` Construct an instance of the UIXSubform.
    `protected` | `UIXSubform(String rendererType)` Construct an instance of the UIXSubform.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected FacesBean.Type` | `getBeanType()`
    `String` | `getFamily()`
    `boolean` | `invokeOnComponent(javax.faces.context.FacesContext context, String clientId, javax.faces.component.ContextCallback callback)` Override to calls the hooks for setting up and tearing down the context before the children are visited.
    `boolean` | `isDefault()` Gets whether the subform should assume it has been submitted.
    `boolean` | `isSubmitted()` Gets whether the subform was submitted on this request
    `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` | `setDefault(boolean defaultParam)` Sets whether the subform should assume it has been submitted.
    `void` | `setSubmitted(boolean submitted)` Sets whether the subform was submitted on this request

    - ### Methods inherited from class org.apache.myfaces.trinidad.component.UIXComponentBase

      `adaptMethodBinding, addAttributeChange, addAttributeChangeListener, addFacesListener, broadcast, broadcastToMethodBinding, broadcastToMethodExpression, createFacesBean, decode, decodeChildren, decodeChildrenImpl, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributeChangeListener, getAttributeChangeListeners, getAttributes, getBooleanProperty, getChildCount, getChildren, getClientId, getContainerClientId, getFacesBean, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacetNames, getFacets, getFacetsAndChildren, getId, getIntProperty, getLifecycleRenderer, getParent, getProperty, getPropertyKey, getRenderer, getRendererType, getRendersChildren, getValueBinding, getValueExpression, invokeOnChildrenComponents, invokeOnNamingContainerComponent, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, removeAttributeChangeListener, removeFacesListener, restoreState, satisfiesPartialTrigger, saveState, setAttributeChangeListener, setAttributeChangeListener, setBooleanProperty, setId, setIntProperty, setParent, setProperty, setRendered, setRendererType, setTransient, setValueBinding, setValueExpression, toString, updateChildren, updateChildrenImpl, validateChildren, validateChildrenImpl`

    - ### Methods inherited from class org.apache.myfaces.trinidad.component.UIXComponent

      `addPartialTarget, clearCachedClientIds, clearCachedClientIds, encodeFlattenedChild, encodeFlattenedChildren, getLogicalParent, getLogicalParent, isVisitable, partialEncodeVisit, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, processFlattenedChildren, setPartialTarget, setupChildrenVisitingContext, setupEncodingContext, setUpEncodingContext, setupVisitingContext, tearDownChildrenVisitingContext, tearDownEncodingContext, tearDownVisitingContext, visitChildren, visitTree, visitTree`

    - ### Methods inherited from class javax.faces.component.UIComponent

      `encodeAll, getContainerClientId`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### TYPE

          public static final FacesBean.Type TYPE

    - #### SUBMITTED_KEY

          public static final PropertyKey SUBMITTED_KEY

    - #### DEFAULT_KEY

          public static final PropertyKey DEFAULT_KEY

    - #### COMPONENT_FAMILY

          public static final String COMPONENT_FAMILY

      See Also:
        Constant Field Values

    - #### COMPONENT_TYPE

          public static final String COMPONENT_TYPE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### UIXSubform

          public UIXSubform()

      Construct an instance of the UIXSubform.

    - #### UIXSubform

          protected UIXSubform(String rendererType)

      Construct an instance of the UIXSubform.

  - ### Method Detail

    - #### queueEvent

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

      Overrides:
        `queueEvent` in class `UIXComponentBase`

    - #### processDecodes

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

      Overrides:
        `processDecodes` in class `UIXComponentBase`

    - #### processValidators

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

      Overrides:
        `processValidators` in class `UIXComponentBase`

    - #### processUpdates

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

      Overrides:
        `processUpdates` in class `UIXComponentBase`

    - #### invokeOnComponent

          public boolean invokeOnComponent(javax.faces.context.FacesContext context,
                                  String clientId,
                                  javax.faces.component.ContextCallback callback)
                                    throws javax.faces.FacesException

      Description copied from class: `UIXComponentBase`
      Override to calls the hooks for setting up and tearing down the context before the children are visited.
      Overrides:
        `invokeOnComponent` in class `UIXComponentBase`
      Throws:
        `javax.faces.FacesException`
      See Also:
        `UIXComponent.setupVisitingContext(javax.faces.context.FacesContext)`, `UIXComponent.tearDownVisitingContext(javax.faces.context.FacesContext)`

    - #### isSubmitted

          public final boolean isSubmitted()

      Gets whether the subform was submitted on this request
      Returns:
        the new submitted value

    - #### setSubmitted

          public final void setSubmitted(boolean submitted)

      Sets whether the subform was submitted on this request
      Parameters:
        `submitted` - the new submitted value

    - #### isDefault

          public final boolean isDefault()

      Gets whether the subform should assume it has been submitted. When set to "true", "submitted" will be considered true if no other subform has been submitted.
      Returns:
        the new default value

    - #### setDefault

          public final void setDefault(boolean defaultParam)

      Sets whether the subform should assume it has been submitted. When set to "true", "submitted" will be considered true if no other subform has been submitted.
      Parameters:
        `defaultParam` - the new default value

    - #### getFamily

          public String getFamily()

      Specified by:
        `getFamily` in class `UIXComponentBase`

    - #### getBeanType

          protected FacesBean.Type getBeanType()

      Overrides:
        `getBeanType` in class `UIXComponentBase`

Copyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.