Please bear in mind both approaches serve different purposes: IMarkupResourceStreamProvider: provide a resource stream no matter where it come from. The stream gets cached and everything, like a normal markup file => is invoked only once
Component.get/setMarkup: allows you to provide your own Component markup irrespective of the parent markup. Usually the markup is determined by the parent container (getParent.getMarkup(this)), but you can provide whatever you want. The render process will skip the component markup in the parent markup. Thus getMarkup is called whenever the Page/Ajax is rendered and no markup has been set (setMarkup). getAssociatedMarkup() is used instead of getMarkup for Panels etc.. Subclassung getMarkup for Panels will not work. Subclass getAssociatedMarkup() instead. (getMarkup can be used for Pages though). -Juergen On Thu, Mar 24, 2011 at 11:09 PM, Juergen Donnerstag <[email protected]> wrote: > yes, makes sense. Feel free to commit the change. > > On Thu, Mar 24, 2011 at 10:38 PM, Martin Grigorov <[email protected]> > wrote: >> + public static Markup get(final String markup) >> >> cool! >> this makes IMarkupResourceStreamProvider a bit redudant >> What about renaming the method to .of(String) so it looks like Model.of() ? >> >> On Thu, Mar 24, 2011 at 8:40 PM, <[email protected]> wrote: >> >>> Author: jdonnerstag >>> Date: Thu Mar 24 19:40:52 2011 >>> New Revision: 1085095 >
