|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
org.apache.myfaces.custom.buffer.AbstractBuffer
public abstract class AbstractBuffer
A component that renders its child components into an in-memory buffer rather than render them directly to the response stream.
Property "into" is an EL expression that specifies where to store a String holding the results of rendering all the children of this component; this is assigned to after rendering of this component (and its children) is complete.
Typically, an h:output tag is then used later in the same page to output the buffer contents.
This can be useful with JSF1.1/JSP2.0 to work around the well-known problem where on first render of a page, a component "A" cannot reference a component "B" which is defined later in the page because it has not yet been created. A solution is to define "B" before "A", but wrapped in a Buffer component. Component A can then be rendered and successfully reference "B" because it now exists. And later in the page, the buffer contents can then be output, preserving the original layout.
This can also be useful when rendering the same data block multiple times within a page. For example, a datatable can be rendered with a datascroller both before and after it; first render the table into a buffer B1, then render the datascroller into a buffer B2, then output buffers B2,B1,B2.
Field Summary | |
---|---|
static String |
COMPONENT_FAMILY
|
static String |
COMPONENT_TYPE
|
Constructor Summary | |
---|---|
AbstractBuffer()
|
Method Summary | |
---|---|
protected abstract String |
getInto()
An EL expression that specifies where to store a String holding the results of rendering all the children of this component; this is assigned to after rendering of this component (and its children) is complete. |
protected abstract String |
getLocalInto()
|
abstract void |
setInto(String into)
|
Methods inherited from class javax.faces.component.UIComponentBase |
---|
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding |
Methods inherited from class javax.faces.component.UIComponent |
---|
getFamily |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String COMPONENT_TYPE
public static final String COMPONENT_FAMILY
Constructor Detail |
---|
public AbstractBuffer()
Method Detail |
---|
protected abstract String getLocalInto()
public abstract void setInto(String into)
protected abstract String getInto()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |