[prev in list] [next in list] [prev in thread] [next in thread] 

List:       velocity-user
Subject:    [Fwd: Re: $velocityHasNext always returning false (Velocity 1.6.2)]
From:       Bogdan Mocanu <bogdan.mocanu.notifications () gmail ! com>
Date:       2009-11-13 15:37:44
Message-ID: 4AFD7D48.2010007 () gmail ! com
[Download RAW message or body]

Hello,

I noticed a space between the name of the property and the value. Try to 
remove that, just to eliminate this from the possible causes. So instead 
of having this in your velocity.properties:

directive.foreach.iterator.name = velocityHasNext

put this:

directive.foreach.iterator.name=velocityHasNext

You could also remove the property completely, since "velocityHasNext" 
is the default name. Please try this, and see if you get any results.

Regards,
Bogdan

mjparme wrote:
> It appears that $velocityHasNext is always returning false.
>
> I have this in my template:
>
> #foreach(${column} in
> ${columns})${column.columnName}#if(${velocityHasNext}),#end#end
>
> The comma is never printed. However, if I change the condition to something
> that is definitely true the comma printed, i.e.:
>
> #foreach(${column} in ${columns})${column.columnName}#if(1 >0),#end#end
>
> I have this property in velocity.properties:
>
> directive.foreach.iterator.name = velocityHasNext
>
> I just want to make sure I am not doing something stupid/obviously wrong
> before opening an issue.
>
> Can anyone provide insight?
>   

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic