public class Fragment extends WebMarkupContainer implements IQueueRegion
Fragments provide a means to maintain the panels tiny piece of markup. Since it can be anywhere, the component whose markup contains the fragment's markup must be provided (markup provider).
<span wicket:id="myPanel">Example input (will be removed)</span> <wicket:fragment wicket:id="frag1">panel 1</wicket:fragment> <wicket:fragment wicket:id="frag2">panel 2</wicket:fragment>
add(new Fragment("myPanel1", "frag1", myPage);
ENABLE, FLAG_AFTER_RENDERING, FLAG_INITIALIZED, FLAG_PREPARED_FOR_RENDER, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RENDERING, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING| Constructor and Description |
|---|
Fragment(String id,
String markupId,
MarkupContainer markupProvider)
Constructor.
|
Fragment(String id,
String markupId,
MarkupContainer markupProvider,
IModel<?> model)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected IMarkupFragment |
chooseMarkup(MarkupContainer provider)
Get the markup stream which shall be used to search for the fragment
|
String |
getAssociatedMarkupId() |
DequeueContext |
newDequeueContext()
Creates a new
DequeueContext that will be used to dequeue children of this region. |
protected IMarkupSourcingStrategy |
newMarkupSourcingStrategy()
If
Component.getMarkupSourcingStrategy() returns null, this method will be called. |
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSessionadd, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onDetach, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildrenadd, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, 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, internalPrepareForRender, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdequeue, getRegionMarkuppublic Fragment(String id, String markupId, MarkupContainer markupProvider)
id - The component idmarkupId - The associated id of the associated markup fragmentmarkupProvider - The component whose markup contains the fragment's markupComponent.Component(String)public Fragment(String id, String markupId, MarkupContainer markupProvider, IModel<?> model)
id - The component idmarkupId - The associated id of the associated markup fragmentmarkupProvider - The component whose markup contains the fragment's markupmodel - The model for this fragmentComponent.Component(String)protected IMarkupSourcingStrategy newMarkupSourcingStrategy()
Component.getMarkupSourcingStrategy() returns null, this method will be called. By default
it returns null, which means that a default markup strategy will be attached to the
component.
Please note that markup source strategies are not persisted. Instead they get re-created by calling this method again. That's ok since markup sourcing strategies usually do not maintain a state.
newMarkupSourcingStrategy in class Componentprotected IMarkupFragment chooseMarkup(MarkupContainer provider)
provider - public final String getAssociatedMarkupId()
public DequeueContext newDequeueContext()
IQueueRegionDequeueContext that will be used to dequeue children of this region.
Usually containers will create a context with their associated markup by getting it via
MarkupContainer.getAssociatedMarkup(), but components that do not render markup in a
standard way (such as repeaters and borders) may choose to override this method to implement
custom behavior for the dequeueing process.newDequeueContext in interface IQueueRegionnewDequeueContext in class MarkupContainerIQueueRegion.newDequeueContext()Copyright © 2006–2021 Apache Software Foundation. All rights reserved.