All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IQueueRegion, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class Fragment extends WebMarkupContainer implements IQueueRegion
Usually you either have a markup file or a xml tag with wicket:id="myComponent" to associate markup with a component. However in some use 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. 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);
 
Author:
Juergen Donnerstag
See Also: