|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.Component org.apache.wicket.MarkupContainer org.apache.wicket.markup.html.WebMarkupContainer org.apache.wicket.markup.repeater.AbstractRepeater
public abstract class AbstractRepeater
Base class for repeaters. This container renders each of its children using its own markup.
The children are collected using renderIterator()
method. This class will take care of
properly positioning and rewinding its markup stream so before each child renders it points to
the beginning of this component. Each child is rendered by a call to
renderChild(Component)
. A typical implementation simply does
child.render();
.
Note: the children are added during the render phase (in Component.beforeRender() so
most of the specializations of this class should not be used as parents of
FormComponent
s in stateless pages because the form components
will not be available during the action phase (i.e. at
Form.onSubmit()
). Use
RepeatingView
in these cases.
Field Summary |
---|
Fields inherited from class org.apache.wicket.Component |
---|
ENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER |
Constructor Summary | |
---|---|
AbstractRepeater(String id)
Constructor |
|
AbstractRepeater(String id,
IModel<?> model)
Constructor |
Method Summary | |
---|---|
IMarkupFragment |
getMarkup(Component child)
Get the childs markup |
protected void |
onBeforeRender()
Called just before a component is rendered only if the component is visible. |
protected abstract void |
onPopulate()
Callback to let the repeater know it should populate itself with its items. |
protected void |
onRender()
Renders all child items in no specified order |
protected void |
renderChild(Component child)
Render a single child. |
protected abstract Iterator<? extends Component> |
renderIterator()
Returns an iterator for the collection of child components to be rendered. |
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer |
---|
getWebPage, getWebRequest, getWebResponse, getWebSession |
Methods inherited from class org.apache.wicket.MarkupContainer |
---|
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkupType, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractRepeater(String id)
id
- public AbstractRepeater(String id, IModel<?> model)
id
- model
- Method Detail |
---|
protected abstract Iterator<? extends Component> renderIterator()
protected final void onRender()
onRender
in class MarkupContainer
Component.onRender()
protected void renderChild(Component child)
child
- Child component to be renderedprotected void onBeforeRender()
Component
NOTE: If you override this, you *must* call super.onBeforeRender() within
your implementation.
Because this method is responsible for cascading Component.onBeforeRender()
call to its
children it is strongly recommended that super call is made at the end of the override.
onBeforeRender
in class Component
Component.onBeforeRender()
public IMarkupFragment getMarkup(Component child)
MarkupContainer
getMarkup
in class MarkupContainer
child
- The child component. If null, the container's markup will be returned. See Border,
Panel or Enclosure where getMarkup(null) != getMarkup().
MarkupContainer.getMarkup(org.apache.wicket.Component)
protected abstract void onPopulate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |