Class RepeatingView

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

    public class RepeatingView
    extends AbstractRepeater

    A repeater view that renders all of its children, using its body markup, in the order they were added.

    Example:

    Java:

     RepeatingView view = new RepeatingView("repeater");
     view.add(new Label(view.newChildId(), "hello"));
     view.add(new Label(view.newChildId(), "goodbye"));
     view.add(new Label(view.newChildId(), "good morning"));
     add(view);
     

    Markup:

      <ul><li wicket:id="repeater"></li></ul>
     

    Yields:

      <ul><li>hello</li><li>goodbye</li><li>good morning</li></ul>
     
    To expand a bit: the repeater itself produces no markup, instead every direct child inherits the entire markup of the repeater. In the example above repeaters's markup is:
      <li wicket:id="repeater"></li>
     
    and so this is the markup that is available to the direct children - the Label components. So as each label renders it produces a line of the output that has the litag.
    Author:
    Igor Vaynberg ( ivaynberg )
    See Also:
    Serialized Form