hi,

On Mon, 30 Sep 2002 22:05:11 -0400, "Howard M. Lewis Ship"
<[EMAIL PROTECTED]> said:

> Block and RenderBlock are the way to go.
> 

so, do you mean something like this would work?

<span jwcid="recursionBlock">
<ul>
    <li><span jwcid="insertValue"/>
        <span jwcid="renderRecursionBlock"/>
    </li>
</ul>
</span>

where the renderRecursionBlock gets recursionBlock as the Block to be
rendered... the part i'm missing is where would i keep the stack for
the recursion? what i did so far to achieve recursion was just a simple
recursive call in a component, as below:

protected void renderComponent(IMarkupWriter writer, IRequestCycle
cycle) throws RequestCycleException {
        this.renderNodes(writer, cycle, this.rootNode);
}

protected void renderNodes(IMarkupWriter writer, IRequestCycle cycle,
ITreeNode node) throws RequestCycleException {
        this.depth++;
        this.value = node;
        this.renderCurrentNode(writer, cycle);
        for (Iterator i=node.getChildren().iterator(); i.hasNext(); ) {
                this.renderNodes( writer, cycle, (ITreeNode)i.next() );
        }
        this.depth--;
}

protected void renderCurrentNode(IMarkupWriter writer, IRequestCycle
cycle) throws RequestCycleException {
        // use writer to render some html for the current node
        (this.value)
}

but obviously this is not very flexible/maintainable, since i'm not
using a tapestry html template...

    viktor

-- 
  
  [EMAIL PROTECTED]



-------------------------------------------------------
This sf.net email is sponsored by: DEDICATED SERVERS only $89!
Linux or FreeBSD, FREE setup, FAST network. Get your own server 
today at http://www.ServePath.com/indexfm.htm
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to