public abstract class AbstractRepeater extends WebMarkupContainer
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.ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING, RFLAG_CONTAINER_HAS_REMOVALS
Constructor and Description |
---|
AbstractRepeater(String id)
Constructor
|
AbstractRepeater(String id,
IModel<?> model)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
dequeue(DequeueContext dequeue)
Dequeues components.
|
IMarkupFragment |
getMarkup(Component child)
Get the markup of the child.
|
protected void |
onBeforeRender()
Called on all visible components before any component is rendered.
|
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.
|
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkupType, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onComponentTagBody, onDetach, onInitialize, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildren
add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public AbstractRepeater(String id)
id
- protected abstract Iterator<? extends Component> renderIterator()
protected final void onRender()
onRender
in class MarkupContainer
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()
public void dequeue(DequeueContext dequeue)
MarkupContainer
MarkupContainer.queue(Component...)
. It then delegates the
dequeueing to these children.
Certain components that implement custom markup behaviors (such as repeaters and borders)
override this method to bring dequeueing in line with their custom markup handling.dequeue
in class MarkupContainer
dequeue
- the dequeue context to useCopyright © 2006–2022 Apache Software Foundation. All rights reserved.