Class Body

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<java.io.Serializable,​Component>, IHeaderContributor, IRequestableComponent, org.apache.wicket.util.IHierarchical<Component>, org.apache.wicket.util.io.IClusterable

    public class Body
    extends WebMarkupContainer
    This is a simple Container component which can be used to build Border like components.

    Example:

     Panel Markup:
     ..
     <div wicket:id="myPanel">
       My Panels body
     </div>
     ..
     
     Panel associated Markup:
     <wicket:panel>
       ..
       <div wicket:id="myBody"/>
       ..
     </wicket:panel>
     
     Panel Java code:
     class MyPanel extends Panel
     {
       ..
       public MyPanel(String id)
       {
          add(new Body("myBody", this);
       }
       ..
     }
     
    There can be any number of containers between the Panel and Body. You must only remember to provide the correct markup provider to the Body.
    Author:
    Juergen Donnerstag
    See Also:
    Serialized Form
    • Constructor Detail

      • Body

        public Body​(java.lang.String id,
                    IModel<?> model,
                    MarkupContainer markupProvider)
        Construct.
        Parameters:
        id -
        model -
        markupProvider - Usually a Panel
      • Body

        public Body​(java.lang.String id,
                    MarkupContainer markupProvider)
        Construct.
        Parameters:
        id -
        markupProvider -
    • Method Detail

      • getMarkup

        public IMarkupFragment getMarkup()
        Description copied from class: Component
        Get the Markup associated with the Component. If not subclassed, the parent container is asked to return the markup of this child component.

        Components like Panel and Border should return the "calling" markup fragment, e.g. <span wicket:id="myPanel">body</span>. You may use Panel/Border/Enclosure.getMarkup(null) to return the associated markup file. And Panel/Border/Enclosure.getMarkup(child) will search the child in the appropriate markup fragment.

        Overrides:
        getMarkup in class Component
        Returns:
        The markup fragment
        See Also:
        MarkupContainer.getMarkup(Component)