org.apache.myfaces.custom.aliasbean
Class AliasBean
java.lang.Object
javax.faces.component.UIComponent
javax.faces.component.UIComponentBase
org.apache.myfaces.custom.aliasbean.AliasBean
- All Implemented Interfaces:
- BindingAware, javax.faces.component.StateHolder
- public class AliasBean
- extends javax.faces.component.UIComponentBase
- implements BindingAware
The aliasBean tag allows you to create a temporary name for a real bean.
The temporary name exists (is visible) only to the children of the aliasBean.
Suppose you have a block of components you use often but with
different beans. The aliasBean allows you to create a separate JSP
page (or equivalent) containing these beans, where the value-bindings
refer to some fictive bean name. Wherever you wish to use this block
you then declare an alias component mapping the fictive name to whatever
bean you really want to apply the block to, then use jsp:include
(or equivalent) to include the reusable block of components. This makes
it possible to have a library of reusable generic subforms.
Note, however, that AliasBean does not work for component bindings; JSF1.1
just has no mechanism available to set up the alias during the "restore view"
phase while the bindings of its children are being re-established, and then
remove the alias after the child bindings are done.
- Version:
- $Revision: 472630 $ $Date: 2006-11-08 21:40:03 +0100 (Mi, 08 Nov 2006) $
- Author:
- Sylvain Vieujot (latest modification by $Author: grantsmith $)
Method Summary |
void |
broadcast(javax.faces.event.FacesEvent event)
|
void |
encodeBegin(javax.faces.context.FacesContext context)
|
void |
encodeEnd(javax.faces.context.FacesContext context)
|
java.lang.String |
getFamily()
|
java.lang.String |
getRendererType()
|
java.lang.String |
getValue()
|
void |
handleBindings()
|
void |
processDecodes(javax.faces.context.FacesContext context)
|
void |
processRestoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
|
java.lang.Object |
processSaveState(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 |
restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
|
java.lang.Object |
saveState(javax.faces.context.FacesContext context)
|
void |
setAlias(java.lang.String aliasBeanExpression)
Define the "fictive" name which will be visible to the children
of this component as an alias to the "real" object specified
by the value attribute of this component. |
void |
setValue(java.lang.String valueExpression)
|
Methods inherited from class javax.faces.component.UIComponentBase |
addFacesListener, decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendersChildren, getValueBinding, isRendered, isTransient, 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 |
COMPONENT_TYPE
public static final java.lang.String COMPONENT_TYPE
- See Also:
- Constant Field Values
COMPONENT_FAMILY
public static final java.lang.String COMPONENT_FAMILY
- See Also:
- Constant Field Values
AliasBean
public AliasBean()
getFamily
public java.lang.String getFamily()
getRendererType
public java.lang.String getRendererType()
setAlias
public void setAlias(java.lang.String aliasBeanExpression)
- Define the "fictive" name which will be visible to the children
of this component as an alias to the "real" object specified
by the value attribute of this component.
- Parameters:
aliasBeanExpression
-
getValue
public java.lang.String getValue()
setValue
public void setValue(java.lang.String valueExpression)
saveState
public java.lang.Object saveState(javax.faces.context.FacesContext context)
- Specified by:
saveState
in interface javax.faces.component.StateHolder
restoreState
public void restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
- Specified by:
restoreState
in interface javax.faces.component.StateHolder
processSaveState
public java.lang.Object processSaveState(javax.faces.context.FacesContext context)
processRestoreState
public void processRestoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
processValidators
public void processValidators(javax.faces.context.FacesContext context)
processDecodes
public void processDecodes(javax.faces.context.FacesContext context)
processUpdates
public void processUpdates(javax.faces.context.FacesContext context)
encodeBegin
public void encodeBegin(javax.faces.context.FacesContext context)
throws java.io.IOException
- Throws:
java.io.IOException
encodeEnd
public void encodeEnd(javax.faces.context.FacesContext context)
throws java.io.IOException
- Throws:
java.io.IOException
queueEvent
public void queueEvent(javax.faces.event.FacesEvent event)
broadcast
public void broadcast(javax.faces.event.FacesEvent event)
throws javax.faces.event.AbortProcessingException
- Throws:
javax.faces.event.AbortProcessingException
handleBindings
public void handleBindings()
- Specified by:
handleBindings
in interface BindingAware
Copyright © 2007 Apache Software Foundation. All Rights Reserved.