From: Keats K. <ke...@xa...> - 2005-07-29 22:12:45
|
Yes the #eval/#templet mechanism is the way to go. You get a new context for each iteration with a reference to the original context. There's an example in the unit tests you can look at. Keats Marc Palmer wrote: >Hi guys, > >I can't reach webmacro.org here - it's resolving but timing out. Eric? > >Anyway, can somebody give me a bit of clarity on WM recursion - I've >forgotten the details. > >Basically I am recursively including a template to render a tree. However >the included template is of course trashing the variables in the "outer" >context. > >Is the solution to this to use #eval or #templet? Something that is part >of WM core is preferred - whereby I can pass in certain values but the >included template fragment gets its own Context. > >I'm using my WM JSP taglib code and it's working well "in anger" here >(literally - the JSP pissed me off so much and caused so much ugliness to >do this recursive rendering, so now we have a JSP/WM hybrid). > >I can "push" the sensitive variables to temp vars before the include and >"pop" them off after but that is ugly indeed. > >Cheers > > > > |