oracle.adf.view.faces.component
Class UIXSwitcher

java.lang.Object
  |
  +--javax.faces.component.UIComponent
        |
        +--oracle.adf.view.faces.component.UIXComponent
              |
              +--oracle.adf.view.faces.component.UIXComponentBase
                    |
                    +--oracle.adf.view.faces.component.SwitcherBase
                          |
                          +--oracle.adf.view.faces.component.UIXSwitcher
All Implemented Interfaces:
javax.faces.component.StateHolder

public class UIXSwitcher
extends SwitcherBase

The switcher component dynamically decides which facet component should be rendered. It has two properties. The switcher will render the facet matching "facetName"; however, if no such facet exists (or "facetName" is null), and "defaultFacet" has been set, then that facet will be used instead. (It's possible to achieve this same functionality by using a panelGroup and binding the "rendered" property of each child, but this component can be simpler. Ordinary children of the switcher component are not rendered at all.)

Example:

 <af:switcher facetName="#{userData.person}" defaultFacet="default">
  <f:facet name="default">
   <af:outputText value="You have not picked anyone I know"/>
  </f:facet >
  <f:facet name="Roger">
   <af:outputText value="You have picked Roger"/>
  </f:facet >
  <f:facet name="Peter">
   <af:outputText value="You have picked Peter"/>
  </f:facet >
 </af:switcher>


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static PropertyKey DEFAULT_FACET_KEY
           
static PropertyKey FACET_NAME_KEY
           
static FacesBean.Type TYPE
           
 
Fields inherited from class oracle.adf.view.faces.component.UIXComponentBase
ID_KEY, RENDERED_KEY, RENDERER_TYPE_KEY, TRANSIENT_KEY
 
Constructor Summary
UIXSwitcher()
          Construct an instance of the UIXSwitcher.
 
Method Summary
protected  FacesBean.Type getBeanType()
           
 java.lang.String getDefaultFacet()
          Gets the name of the facet to render and process if "facetName" is null or otherwise does not refer to an existing facet.
 java.lang.String getFacetName()
          Gets the name of the facet to render and process.
 java.lang.String getFamily()
           
 void setDefaultFacet(java.lang.String defaultFacet)
          Sets the name of the facet to render and process if "facetName" is null or otherwise does not refer to an existing facet.
 void setFacetName(java.lang.String facetName)
          Sets the name of the facet to render and process.
 
Methods inherited from class oracle.adf.view.faces.component.SwitcherBase
encodeChildren, getRendersChildren, processDecodes, processUpdates, processValidators
 
Methods inherited from class oracle.adf.view.faces.component.UIXComponentBase
addFacesListener, broadcast, createFacesBean, decode, encodeBegin, encodeEnd, findComponent, getAttribute, getAttributes, getBooleanProperty, getChildCount, getChildren, getClientId, getFacesBean, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getIntProperty, getLocalClientId, getParent, getProperty, getPropertyKey, getRenderer, getRendererType, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreState, saveState, setAttribute, setBooleanProperty, setId, setIntProperty, setParent, setProperty, setRendered, setRendererType, setTransient, setValueBinding, toString
 
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

FACET_NAME_KEY

public static final PropertyKey FACET_NAME_KEY

DEFAULT_FACET_KEY

public static final PropertyKey DEFAULT_FACET_KEY

COMPONENT_FAMILY

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

COMPONENT_TYPE

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

UIXSwitcher

public UIXSwitcher()
Construct an instance of the UIXSwitcher.

Method Detail

getFacetName

public final java.lang.String getFacetName()
Gets the name of the facet to render and process.

This is a required property on the bean.

Specified by:
getFacetName in class SwitcherBase

setFacetName

public final void setFacetName(java.lang.String facetName)
Sets the name of the facet to render and process.

This is a required property on the bean.


getDefaultFacet

public final java.lang.String getDefaultFacet()
Gets the name of the facet to render and process if "facetName" is null or otherwise does not refer to an existing facet.

Specified by:
getDefaultFacet in class SwitcherBase

setDefaultFacet

public final void setDefaultFacet(java.lang.String defaultFacet)
Sets the name of the facet to render and process if "facetName" is null or otherwise does not refer to an existing facet.


getFamily

public java.lang.String getFamily()
Specified by:
getFamily in class UIXComponentBase

getBeanType

protected FacesBean.Type getBeanType()
Overrides:
getBeanType in class UIXComponentBase


Copyright © 2003-2004 Oracle Corporation. All Rights Reserved.