|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.Component
wicket.MarkupContainer
wicket.markup.html.WebMarkupContainer
wicket.markup.html.panel.Fragment
public class Fragment
Usually you either have a markup file or a xml tag with wicket:id="myComponent" to associate markup with a component. However in some rare cases, especially when working with small panels it is a bit awkward to maintain tiny pieces of markup in plenty of panel markup files. Use cases are for example list views where list items are different depending on a state.
Fragments provide a means to maintain the panels tiny piece of markup in the parents markup file.
<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");
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class wicket.Component |
|---|
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor, Component.VisibilityChange |
| Field Summary |
|---|
| Fields inherited from class wicket.Component |
|---|
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER |
| Constructor Summary | |
|---|---|
Fragment(java.lang.String id,
java.lang.String markupId)
Constructor. |
|
Fragment(java.lang.String id,
java.lang.String markupId,
IModel model)
Constructor. |
|
Fragment(java.lang.String id,
java.lang.String markupId,
MarkupContainer markupProvider)
Constructor. |
|
Fragment(java.lang.String id,
java.lang.String markupId,
MarkupContainer markupProvider,
IModel model)
Constructor. |
|
| Method Summary | |
|---|---|
protected MarkupStream |
chooseMarkupStream(MarkupStream markupStream)
Get the markup stream which shall be used to search for the fragment |
protected void |
onComponentTag(ComponentTag tag)
Make sure we open up open-close tags to open-body-close |
protected void |
onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
Handle the container's body. |
void |
setMarkupTagReferenceId(java.lang.String markupId)
The associated markup fragment can be modified |
| Methods inherited from class wicket.markup.html.WebMarkupContainer |
|---|
getMarkupType, getWebPage |
| Methods inherited from class wicket.MarkupContainer |
|---|
add, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, internalAdd, internalAttach, internalDetach, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, toString, visitChildren, visitChildren |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Fragment(java.lang.String id,
java.lang.String markupId)
id - The component idmarkupId - The associated id of the associated markup fragmentComponent.Component(String)
public Fragment(java.lang.String id,
java.lang.String markupId,
IModel model)
id - The component idmarkupId - The associated id of the associated markup fragmentmodel - The model for this fragmentComponent.Component(String)
public Fragment(java.lang.String id,
java.lang.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(java.lang.String id,
java.lang.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)| Method Detail |
|---|
public final void setMarkupTagReferenceId(java.lang.String markupId)
markupId - protected void onComponentTag(ComponentTag tag)
onComponentTag in class Componenttag - Tag to modifyComponent.onComponentTag(wicket.markup.ComponentTag)
protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
MarkupContainer
onComponentTagBody in class MarkupContainermarkupStream - The markup streamopenTag - The open tag for the bodyComponent.onComponentTagBody(wicket.markup.MarkupStream,
wicket.markup.ComponentTag)protected MarkupStream chooseMarkupStream(MarkupStream markupStream)
markupStream - The markup stream is associated with the component (not the
fragment)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||