public abstract class Block extends AbstractComponent
RenderBlock
component. [Component Reference]
Block and RenderBlock
are used to build a certain class of complicated component that
can't be assembled using the normal wrapping containment. Such a super component would have two
or more sections that need to be supplied by the containing page (or component).
Using Blocks, the blocks can be provided as parameters to the super component.
The invoker property gives the components inside the block access to the component (typically an
RenderBlock
) that rendered the block. More often, the getParameter(String)
method is used to get parameters of the invoking component.
Constructor and Description |
---|
Block() |
Modifier and Type | Method and Description |
---|---|
IComponent |
getInserter()
Deprecated.
Use
getInvoker() instead. |
IComponent |
getInvoker()
Returns the object which invoked this Block's
renderForComponent(IMarkupWriter, IRequestCycle, IComponent) method. |
java.lang.Object |
getParameter(java.lang.String name)
Provides access to the invoking component's parameters.
|
protected void |
renderComponent(IMarkupWriter writer,
IRequestCycle cycle)
Does nothing; the idea of a Block is to defer the rendering of the body of the block until an
RenderBlock forces it out. |
void |
renderForComponent(IMarkupWriter writer,
IRequestCycle cycle,
IComponent invoker) |
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString
public Block()
public java.lang.Object getParameter(java.lang.String name)
public void renderForComponent(IMarkupWriter writer, IRequestCycle cycle, IComponent invoker)
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
RenderBlock
forces it out.renderComponent
in class AbstractComponent
public IComponent getInserter()
getInvoker()
instead.public IComponent getInvoker()
renderForComponent(IMarkupWriter, IRequestCycle, IComponent)
method. This is often
used to access the informal parameters of a RenderBlock
component.