A coworker of mine with much Tapesty-fu seems to have figured out a much more
elegant solution today. (this issue has blocked most of the team, so we both
attacked this problem simultaneously).  He blogged about it here:
http://blog.bolkey.com/2009/06/06/tapestry-5-recursive-tree/

The short of it is, you have to use <t:body> delegates in the tree
templates, and when you declare the component, be sure to put down a
delegate, go give the inner logic a chance to continue to walk the tree, and
fiddle around with the before/after BodyRender methods.   Also, caching was
a bit of a problem until he learned to turn it off...

Anyway, thanks all,
Seth


ownedthx wrote:
> 
> Yesterday I opened a feature request for recursive components,
> https://issues.apache.org/jira/browse/TAP5-739, and had it closed for the
> reasons described there (basically, 'not possible').
> 
> First of all, thanks Thiago for taking the time to describe the issue and
> the pointer to a technique as a workaround.
> 
> Here's my question about the suggested workaround (which I'll call the
> 'use MarkupWriter' technique).  I have two reasons why I want to avoid a
> markupwriter:
> 
> 1) We have many components already designed that fit in a tree structure
> (10 now, but easily 200 later).  We would like to have the template in a
> tml file, so that a UI designer can contribute without being a Java expert
> on our numerous templates.
> 
> 2) More importantly, components allow us to associate behavior (ajax,
> forms, actionlinks, etc) with our components in a very clean, modular way.  
> 
> With a MarkupWriter technique, I believe we lose both.  
> 
> Does anyone have any suggestions as to how we can pull off recursion of
> components (or something like it), while achieving #1 and #2?
> 
> Thanks for any help,
> 
> Seth
> 

-- 
View this message in context: 
http://n2.nabble.com/Stuck-on-implementing-recursion-%28or-something-like-it%29-cleanly-tp3032700p3036739.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to