Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We used to have different entry points to render a Page, a Component for a web request and a Component for an AJAX request. That is history. Whenever you want to render a component, simply call component.render().

You 'll notice may recall that Component.render(MarkupStream) already existed and thus in most cases (e.g. IComponentResolvers implementations) you simply need to remove the markupStream parameter.

The markup fragment which is still needed to render a Component will be is retrieved via Component.getMarkup(). Most components will ask their parent container to find it via MarkupContainer.getMarkup(Component child).

IMarkupFragment is a new concept introduced. A markup fragment is what is says: a fragment of markup taken from a larger resource (file). Please see the javadoc on when it is better to subclass getMarkup() and when getMarkup(Component).

Component.getMarkup() successfully returns a result as soon as it is connected (add) to a parent with an associated markup resource (file). Note that this usually is not in the component constructor, since the component itself will not yet been added to its parent.

You may know recall that until now you very carefully had to forward the markup stream to the next suitable position. That has been simplified as well. Every component will use its own markup stream and the parent container is responsible to position it while rendering its child components.

...