velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hervé Guidetti <herve.guide...@idbsoft.ch>
Subject Re: Recurivity with Velocimacro
Date Tue, 27 Mar 2001 13:27:19 GMT
Oooooooh yes,

Thank a lot
Hervé

----- Original Message -----
From: Geir Magnusson Jr. <geirm@optonline.net>
To: <velocity-user@jakarta.apache.org>
Sent: Tuesday, March 27, 2001 4:19 PM
Subject: Re: Recurivity with Velocimacro


> Hervé Guidetti wrote:
> >
> > Hi all,
> >
> > I need to create a tree with Velocity. So I need to write a Velocimacro
> > (displaying subTree) and calling it recursivly.
> >
> > I tried to do it like that but it doesn't work.
> >
> > #showsub($root)
> > #macro (showsub $sub_root)
> >  #foreach ($child in $sub_root.getAllChilds())
> >     <tr>
> >     <td valign=top>
> >      <img src="/img/sommaire/carre.gif" vspace=5></td>
> >     <td>
> >      $child.title
> >     </td></tr>
> >     #showsub($child)
> >  #end
> > #end
> >
> > The first level of my tree is diplayed but the recurcivity doesn't work.
> > Any idea to do that ?
>
> Put the call to showsub after the definition, see if that straightens it
> out.
>
> I know recursive VMs work just fine - in the whiteboard directory is an
> example of a treewalking VM that will walk and print out a JDOM tree.
>
> geir
> --
> Geir Magnusson Jr.                               geirm@optonline.net
> Developing for the web?  See http://jakarta.apache.org/velocity/
>


Mime
View raw message