velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <>
Subject Re: Clearing content for dynamically constructed variables - Urgent
Date Sun, 19 Sep 2004 12:05:02 GMT
Hi Ravikanth,

> Now i am facing one more problem. Suppose i have 5
> elements in the first level of hierarchy and in the
> macro i have construted variables for them and used
> them for rendering. And now if i get only 3 elements
> for the second iteration, it will construct variables
> newly only for the 3 elements. So, still i be will
> left out with five variables( 3 new and 2 old from
> parent hierarchy). So, it will render the data with
> few old values. I read in the velocity user guide
> that, once the variable is set to the context, there
> is no way to remove it from the context or set it to
> null.
As for removing something from the context, take a look at the thread
starting with

> What may be the better solution for my problem?
Each time you call the macro, you can tell what's set by
$catItem.getElementList(), right?  Then why don't you use that?  Or, if
you have access to the Java code of whatever is in $catItem, I would add
some public methods to let Velocity know what to do, a lot more simply. 
MVC, remember?

Best regards,
-- Shinobu Kawai

Shinobu Kawai(

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message