Now that I am working with the markupresourcestream directly, I am beginning to think that Wicket should support dually both component hierarchy and markup hierarchy.
Wicket chould have two kinds of add methods: add(Component c) add(String anchorId, MarkupResourceStreamProvider c) Such a MarkupResourceStreamProvider object could basically look same as a component (having setvisible,setenabled,addbehavior,etc.), but when it is added, its output would be injected to the parent's markup stream at anchor position (instead of a component being added to a component tree). The benefit would be, for a "stateless" component, its markup result could be automagically cached and the "component" itself that defined the markup, would not remain to waste any resources. Even better, the output of such a MarkupResourceStreamProvider should be logically a chain of "strings" alternating with possible IModels such that dynamic model values could be updated every time parent is re-rendered. Any comments? ..my2wildThughts.. ** Martin 2012/2/25 Martin Makundi <martin.maku...@koodaripalvelut.com>: > Also > > public IResourceStream getMarkupResourceStream(MarkupContainer > container, Class<?> containerClass) { > > seems quite feasible for making conditional markup. > > However, I must override > MarkupContainer.getAssociatedMarkupStream(enforceReload=true) and > IMarkupCacheKeyProvider.getCacheKey(==null) to get a different markup > for each component. > > > > ** > Martin > > > 2012/2/25 Martin Makundi <martin.maku...@koodaripalvelut.com>: >> @Per about >> http://www.small-improvements.com/blog/technical/tuning-wicket-session-size >> >> You say "If condition A is met, show label A. If not, use >> setVisible(false) to hide it. Combine that with Enclosures... Trouble >> is, while the hidden component doesn't show up in the markup, it's >> still part of the component tree! " >> >> I remember sometimes when using enclosures, I have rendered a page >> which has not added some components inside an enclosure. Maybe there >> could be a way to mark a region in the markup (like enclosure) where a >> component can be optionally added. >> >> This way "setVisible=false" could be achieved simply by not adding >> that component. >> >> >> >> ** >> Martin --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org