velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <shinobu.ka...@gmail.com>
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
   http://www.mail-archive.com/velocity-user@jakarta.apache.org/msg13203.html

> 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(shinobu.kawai@gmail.com)

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message