org.richfaces.component

## Class AbstractTogglePanel

- java.lang.Object
- - javax.faces.component.UIComponent
  - - javax.faces.component.UIComponentBase
    - - javax.faces.component.UIOutput
      - - org.richfaces.component.AbstractTogglePanel

- All Implemented Interfaces:
    EventListener, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.component.TransientStateHolder, javax.faces.component.ValueHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder, AbstractDivPanel, CoreProps, EventsMouseProps, I18nProps, MetaComponentEncoder, MetaComponentResolver, ItemChangeSource
  Direct Known Subclasses:
    AbstractAccordion, AbstractCollapsiblePanel, AbstractTabPanel, UITogglePanel

      public abstract class AbstractTogglePanel
      extends javax.faces.component.UIOutput
      implements AbstractDivPanel, ItemChangeSource, MetaComponentResolver, MetaComponentEncoder, CoreProps, EventsMouseProps, I18nProps

  The <rich:togglePanel> component is used as a base for the other switchable components, the <rich:accordion> component and the <rich:tabPanel> component. It provides an abstract switchable component without any associated markup. As such, the <rich:togglePanel> component could be customized to provide a switchable component when neither an accordion component or a tab panel component is appropriate.

  Author:
    akolonitsky, Brian Leathem

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ACTIVE_ITEM_META_COMPONENT`
    `static String` | `COMPONENT_FAMILY`
    `static String` | `COMPONENT_TYPE`
    `static String` | `META_NAME_FIRST`
    `static String` | `META_NAME_LAST`
    `static String` | `META_NAME_NEXT`
    `static String` | `META_NAME_PREV`
    `static String` | `UPDATE_MESSAGE_ID`

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

      `ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY`

    - ### Fields inherited from interface org.richfaces.component.MetaComponentResolver

      `META_COMPONENT_SEPARATOR_CHAR`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractTogglePanel()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addItemChangeListener(ItemChangeListener listener)` Add a new `ItemChangeListener` to the set of listeners interested in being notified when `ItemChangeEvent`s occur.
    `void` | `broadcast(javax.faces.event.FacesEvent event)`
    `void` | `decode(javax.faces.context.FacesContext facesContext)`
    `void` | `encodeBegin(javax.faces.context.FacesContext facesContext)`
    `void` | `encodeMetaComponent(javax.faces.context.FacesContext facesContext, String metaComponentId)`
    `String` | `getActiveItem()` Holds the active panel name.
    `int` | `getChildIndex(String name)` Deprecated.
    `String` | `getClientIdByName(String name)`
    `abstract Object` | `getData()`
    `abstract Object` | `getExecute()`
    `String` | `getFamily()`
    `AbstractTogglePanelItemInterface` | `getFirstItem()`
    `int` | `getIndexByName(String name)`
    `AbstractTogglePanelItemInterface` | `getItem(String name)`
    `AbstractTogglePanelItemInterface` | `getItemByIndex(int index)`
    `abstract javax.el.MethodExpression` | `getItemChangeListener()` Occurs on the server side when an item is changed through Ajax using the server mode
    `ItemChangeListener[]` | `getItemChangeListeners()` Return the set of registered `ItemChangeListener`s for this instance.
    `int` | `getItemCount()`
    `AbstractTogglePanelItemInterface` | `getLastItem()`
    `String` | `getNameByIndex(int index)`
    `AbstractTogglePanelItemInterface` | `getNextItem()`
    `AbstractTogglePanelItemInterface` | `getNextItem(String name)`
    `abstract String` | `getOnbeforeitemchange()` The client-side script method to be called before the item is changed.
    `abstract String` | `getOnitemchange()` The client-side script method to be called after the item is changed.
    `AbstractTogglePanelItemInterface` | `getPrevItem()`
    `AbstractTogglePanelItemInterface` | `getPrevItem(String name)`
    `abstract Object` | `getRender()`
    `boolean` | `getRendersChildren()`
    `abstract String` | `getStatus()`
    `String` | `getSubmittedActiveItem()`
    `Object` | `getSubmittedValue()`
    `SwitchType` | `getSwitchType()` The switch mode when a panel is activated.
    `TogglePanelVisitState` | `getVisitStateByName(String name)`
    `protected boolean` | `isActiveItem(AbstractTogglePanelItemInterface item, String value)`
    `boolean` | `isActiveItem(javax.faces.component.UIComponent kid)`
    `protected boolean` | `isActiveItem(javax.faces.component.UIComponent kid, String value)`
    `abstract boolean` | `isCycledSwitching()` Applicable when cycling through the tabs.
    `boolean` | `isImmediate()` Flag indicating that this component's value must be converted and validated immediately (that is, during Apply Request Values phase), rather than waiting until Process Validations phase.
    `abstract boolean` | `isLimitRender()`
    `boolean` | `isLocalValueSet()`
    `static boolean` | `isPanelItemDynamic(javax.faces.component.UIComponent component)`
    `boolean` | `isRequired()`
    `boolean` | `isValid()`
    `void` | `processDecodes(javax.faces.context.FacesContext facesContext)` Specialized decode behavior on top of that provided by the superclass.
    `void` | `processUpdates(javax.faces.context.FacesContext facesContext)` In addition to the standard `processUpdates` behavior inherited from `UIComponentBase`, calls `updateModel()`.
    `void` | `processValidators(javax.faces.context.FacesContext facesContext)` In addition to the standard `processValidators` behavior inherited from `UIComponentBase`, calls `processValue()` if the `immediate` property is false (which is the default); if the component is invalid afterwards, calls `FacesContext.renderResponse()`.
    `void` | `queueEvent(javax.faces.event.FacesEvent event)`
    `void` | `removeItemChangeListener(ItemChangeListener listener)` Remove an existing `ItemChangeListener` (if any) from the set of listeners interested in being notified when `ItemChangeEvent`s occur.
    `void` | `resetValue()`
    `String` | `resolveClientId(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent contextComponent, String metaComponentId)` Resolves and returns string identifying supported meta-component or `null` if provided meta-component name is not a supported one.
    `void` | `setActiveItem(String value)`
    `protected void` | `setEventPhase(javax.faces.event.FacesEvent event)`
    `protected void` | `setEventPhase(ItemChangeEvent event)`
    `void` | `setImmediate(boolean immediate)`
    `void` | `setLocalValueSet(boolean localValueSet)`
    `void` | `setRequired(boolean required)` Set the "required field" state for this component.
    `void` | `setSubmittedActiveItem(String submittedActiveItem)`
    `void` | `setSubmittedValue(Object submittedValue)`
    `void` | `setSwitchType(SwitchType switchType)`
    `void` | `setValid(boolean valid)`
    `void` | `setValue(Object value)`
    `void` | `setValueExpression(String name, javax.el.ValueExpression binding)`
    `String` | `substituteUnresolvedClientId(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent contextComponent, String metaComponentId)` Provides replacement for unresolved meta-component names.
    `String` | `updateActiveName(String activeItemName)`
    `void` | `updateModel(javax.faces.context.FacesContext facesContext)`
    `protected javax.faces.component.visit.VisitResult` | `visitMetaComponents(ExtendedVisitContext extendedVisitContext, javax.faces.component.visit.VisitCallback callback)`
    `TogglePanelVisitState` | `visitTogglePanelItems(AbstractTogglePanel panel, TogglePanelVisitCallback callback)`
    `boolean` | `visitTree(javax.faces.component.visit.VisitContext context, javax.faces.component.visit.VisitCallback callback)`

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

      `clearInitialState, getConverter, getLocalValue, getValue, markInitialState, restoreState, saveState, setConverter`

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

      `addClientBehavior, addFacesListener, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent`

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

      `encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView`

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

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

    - ### Methods inherited from interface org.richfaces.component.attribute.CoreProps

      `getStyle, getStyleClass, getTitle`

    - ### Methods inherited from interface org.richfaces.component.attribute.EventsMouseProps

      `getOnclick, getOndblclick, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup`

    - ### Methods inherited from interface org.richfaces.component.attribute.I18nProps

      `getDir, getLang`

- - ### Field Detail

    - #### ACTIVE_ITEM_META_COMPONENT

          public static final String ACTIVE_ITEM_META_COMPONENT

      See Also:
        Constant Field Values

    - #### COMPONENT_TYPE

          public static final String COMPONENT_TYPE

      See Also:
        Constant Field Values

    - #### COMPONENT_FAMILY

          public static final String COMPONENT_FAMILY

      See Also:
        Constant Field Values

    - #### META_NAME_FIRST

          public static final String META_NAME_FIRST

      See Also:
        Constant Field Values

    - #### META_NAME_PREV

          public static final String META_NAME_PREV

      See Also:
        Constant Field Values

    - #### META_NAME_NEXT

          public static final String META_NAME_NEXT

      See Also:
        Constant Field Values

    - #### META_NAME_LAST

          public static final String META_NAME_LAST

      See Also:
        Constant Field Values

    - #### UPDATE_MESSAGE_ID

          public static final String UPDATE_MESSAGE_ID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AbstractTogglePanel

          protected AbstractTogglePanel()

  - ### Method Detail

    - #### isPanelItemDynamic

          public static boolean isPanelItemDynamic(javax.faces.component.UIComponent component)

    - #### getSubmittedValue

          public Object getSubmittedValue()

    - #### resetValue

          public void resetValue()

      Overrides:
        `resetValue` in class `javax.faces.component.UIOutput`

    - #### setSubmittedValue

          public void setSubmittedValue(Object submittedValue)

    - #### isLocalValueSet

          public boolean isLocalValueSet()

    - #### setLocalValueSet

          public void setLocalValueSet(boolean localValueSet)

    - #### isValid

          public boolean isValid()

    - #### setValid

          public void setValid(boolean valid)

    - #### isRequired

          public boolean isRequired()

    - #### setRequired

          public void setRequired(boolean required)

      Set the "required field" state for this component.

      Parameters:
        `required` - The new "required field" state

    - #### isImmediate

          public boolean isImmediate()

      Flag indicating that this component's value must be converted and validated immediately (that is, during Apply Request Values phase), rather than waiting until Process Validations phase.

    - #### setImmediate

          public void setImmediate(boolean immediate)

    - #### encodeBegin

          public void encodeBegin(javax.faces.context.FacesContext facesContext)
                           throws IOException

      Overrides:
        `encodeBegin` in class `javax.faces.component.UIComponentBase`
      Throws:
        `IOException`

    - #### updateActiveName

          public String updateActiveName(String activeItemName)

    - #### processDecodes

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

      Specialized decode behavior on top of that provided by the superclass. In addition to the standard `processDecodes` behavior inherited from `UIComponentBase`, calls `processValue()` if the the `immediate` property is true; if the component is invalid afterwards or a `RuntimeException` is thrown, calls `FacesContext.renderResponse()`.

      Overrides:
        `processDecodes` in class `javax.faces.component.UIComponentBase`
      Throws:
        `NullPointerException`

    - #### processValidators

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

      In addition to the standard `processValidators` behavior inherited from `UIComponentBase`, calls `processValue()` if the `immediate` property is false (which is the default); if the component is invalid afterwards, calls `FacesContext.renderResponse()`. If a `RuntimeException` is thrown during validation processing, calls `FacesContext.renderResponse()` and re-throw the exception.

      Overrides:
        `processValidators` in class `javax.faces.component.UIComponentBase`
      Throws:
        `NullPointerException`

    - #### processUpdates

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

      In addition to the standard `processUpdates` behavior inherited from `UIComponentBase`, calls `updateModel()`. If the component is invalid afterwards, calls `FacesContext.renderResponse()`. If a `RuntimeException` is thrown during update processing, calls `FacesContext.renderResponse()` and re-throw the exception.

      Overrides:
        `processUpdates` in class `javax.faces.component.UIComponentBase`
      Throws:
        `NullPointerException`

    - #### decode

          public void decode(javax.faces.context.FacesContext facesContext)

      Overrides:
        `decode` in class `javax.faces.component.UIComponentBase`
      Throws:
        `NullPointerException`

    - #### updateModel

          public void updateModel(javax.faces.context.FacesContext facesContext)

    - #### queueEvent

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

      Overrides:
        `queueEvent` in class `javax.faces.component.UIComponentBase`

    - #### setEventPhase

          protected void setEventPhase(ItemChangeEvent event)

    - #### setEventPhase

          protected void setEventPhase(javax.faces.event.FacesEvent event)

    - #### broadcast

          public void broadcast(javax.faces.event.FacesEvent event)
                         throws javax.faces.event.AbortProcessingException

      Overrides:
        `broadcast` in class `javax.faces.component.UIComponentBase`
      Throws:
        `javax.faces.event.AbortProcessingException`

    - #### getFamily

          public String getFamily()

      Overrides:
        `getFamily` in class `javax.faces.component.UIOutput`

    - #### getRendersChildren

          public boolean getRendersChildren()

      Overrides:
        `getRendersChildren` in class `javax.faces.component.UIComponentBase`

    - #### isActiveItem

          public boolean isActiveItem(javax.faces.component.UIComponent kid)

    - #### isActiveItem

          protected boolean isActiveItem(javax.faces.component.UIComponent kid,
                             String value)

    - #### isActiveItem

          protected boolean isActiveItem(AbstractTogglePanelItemInterface item,
                             String value)

    - #### visitTogglePanelItems

          public TogglePanelVisitState visitTogglePanelItems(AbstractTogglePanel panel,
                                                    TogglePanelVisitCallback callback)

    - #### getVisitStateByName

          public TogglePanelVisitState getVisitStateByName(String name)

    - #### getItemByIndex

          public AbstractTogglePanelItemInterface getItemByIndex(int index)

    - #### getNameByIndex

          public String getNameByIndex(int index)

    - #### getIndexByName

          public int getIndexByName(String name)

    - #### getClientIdByName

          public String getClientIdByName(String name)

    - #### getItemCount

          public int getItemCount()

    - #### getItem

          public AbstractTogglePanelItemInterface getItem(String name)

    - #### getFirstItem

          public AbstractTogglePanelItemInterface getFirstItem()

    - #### getPrevItem

          public AbstractTogglePanelItemInterface getPrevItem()

    - #### getPrevItem

          public AbstractTogglePanelItemInterface getPrevItem(String name)

    - #### getNextItem

          public AbstractTogglePanelItemInterface getNextItem()

    - #### getNextItem

          public AbstractTogglePanelItemInterface getNextItem(String name)

    - #### getLastItem

          public AbstractTogglePanelItemInterface getLastItem()

    - #### getChildIndex

          @Deprecated
          public int getChildIndex(String name)

      Deprecated.

    - #### getSubmittedActiveItem

          public String getSubmittedActiveItem()

    - #### setSubmittedActiveItem

          public void setSubmittedActiveItem(String submittedActiveItem)

    - #### setValue

          public void setValue(Object value)

      Specified by:
        `setValue` in interface `javax.faces.component.ValueHolder`
      Overrides:
        `setValue` in class `javax.faces.component.UIOutput`

    - #### getActiveItem

          public String getActiveItem()

      Holds the active panel name. This name is a reference to the name identifier of the active child <rich:togglePanelItem> component.

    - #### setActiveItem

          public void setActiveItem(String value)

    - #### setValueExpression

          public void setValueExpression(String name,
                                javax.el.ValueExpression binding)

      Overrides:
        `setValueExpression` in class `javax.faces.component.UIComponent`

    - #### getSwitchType

          public SwitchType getSwitchType()

      The switch mode when a panel is activated. One of: "client", "server", "ajax". Default: "ajax"

    - #### setSwitchType

          public void setSwitchType(SwitchType switchType)

    - #### isLimitRender

          public abstract boolean isLimitRender()

    - #### isCycledSwitching

          public abstract boolean isCycledSwitching()

      Applicable when cycling through the tabs. If "true", then when the last tab is active, cycling to next will activate the first tab, if "false", cycling to next will have not effect. The inverse applies for the first tab, and cycling to previous. Whether to Default: false

    - #### getData

          public abstract Object getData()

    - #### getStatus

          public abstract String getStatus()

    - #### getExecute

          public abstract Object getExecute()

    - #### getRender

          public abstract Object getRender()

    - #### getItemChangeListener

          public abstract javax.el.MethodExpression getItemChangeListener()

      Occurs on the server side when an item is changed through Ajax using the server mode

    - #### getOnitemchange

          public abstract String getOnitemchange()

      The client-side script method to be called after the item is changed.

    - #### getOnbeforeitemchange

          public abstract String getOnbeforeitemchange()

      The client-side script method to be called before the item is changed.

    - #### addItemChangeListener

          public void addItemChangeListener(ItemChangeListener listener)

      Description copied from interface: `ItemChangeSource`

      Add a new `ItemChangeListener` to the set of listeners interested in being notified when `ItemChangeEvent`s occur.

      Specified by:
        `addItemChangeListener` in interface `ItemChangeSource`
      Parameters:
        `listener` - The `ItemChangeListener` to be added

    - #### getItemChangeListeners

          public ItemChangeListener[] getItemChangeListeners()

      Description copied from interface: `ItemChangeSource`

      Return the set of registered `ItemChangeListener`s for this instance. If there are no registered listeners, a zero-length array is returned.

      Specified by:
        `getItemChangeListeners` in interface `ItemChangeSource`

    - #### removeItemChangeListener

          public void removeItemChangeListener(ItemChangeListener listener)

      Description copied from interface: `ItemChangeSource`

      Remove an existing `ItemChangeListener` (if any) from the set of listeners interested in being notified when `ItemChangeEvent`s occur.

      Specified by:
        `removeItemChangeListener` in interface `ItemChangeSource`
      Parameters:
        `listener` - The `ItemChangeListener` to be removed

    - #### resolveClientId

          public String resolveClientId(javax.faces.context.FacesContext facesContext,
                               javax.faces.component.UIComponent contextComponent,
                               String metaComponentId)

      Description copied from interface: `MetaComponentResolver`
      Resolves and returns string identifying supported meta-component or `null` if provided meta-component name is not a supported one.
      Specified by:
        `resolveClientId` in interface `MetaComponentResolver`
      Parameters:
        `facesContext` - - current instance of `FacesContext`
        `contextComponent` - - instance of `UIComponent` that requested resolution of meta-component
        `metaComponentId` - - name of meta-component (without leading '@' sign)
      Returns:
        clientId, one of supported meta-names such as @all, @this, etc. or `null`

    - #### substituteUnresolvedClientId

          public String substituteUnresolvedClientId(javax.faces.context.FacesContext facesContext,
                                            javax.faces.component.UIComponent contextComponent,
                                            String metaComponentId)

      Description copied from interface: `MetaComponentResolver`
      Provides replacement for unresolved meta-component names. Returns identifier string for the chosen substitution or `null`
      Specified by:
        `substituteUnresolvedClientId` in interface `MetaComponentResolver`
      Parameters:
        `facesContext` - - current instance of `FacesContext`
        `contextComponent` - - instance of `UIComponent` that requested resolution of meta-component
        `metaComponentId` - - name of meta-component (without leading '@' sign)
      Returns:
        clientId, one of supported meta-names such as @all, @this, etc. or `null`

    - #### encodeMetaComponent

          public void encodeMetaComponent(javax.faces.context.FacesContext facesContext,
                                 String metaComponentId)
                                   throws IOException

      Specified by:
        `encodeMetaComponent` in interface `MetaComponentEncoder`
      Throws:
        `IOException`

    - #### visitTree

          public boolean visitTree(javax.faces.component.visit.VisitContext context,
                          javax.faces.component.visit.VisitCallback callback)

      Overrides:
        `visitTree` in class `javax.faces.component.UIComponent`

    - #### visitMetaComponents

          protected javax.faces.component.visit.VisitResult visitMetaComponents(ExtendedVisitContext extendedVisitContext,
                                                                    javax.faces.component.visit.VisitCallback callback)

Copyright © 2015 JBoss by Red Hat. All Rights Reserved.