velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eddie Ridwan" <eddie.rid...@zoominti.com>
Subject Problem with $velocityHasNext in Spring
Date Mon, 23 Feb 2009 04:03:10 GMT
I am using Velocity views in Spring 2.5 (velocity-1.5.jar). The problem I
have is that $velocityHasNext does not seem to be recognized as a foreach
loop variable.

 

Here is my template excerpt:

 

            #foreach ($pagerLink in $resultpage.getPagerLinks())

                  #set ($value = $resultpage.getStartPage() + $velocityCount
- 1)

                  #if ($resultpage.getCurrentPage() == $velocityCount)

                        <td class=b>$value #if( $velocityHasNext ) |
#end</td>

                  #else

                        <td class=b><a
href="keypagelist.htm?offset=$pagerLink">$value</a>#if( $velocityHasNext ) |
#end</td>

                  #end

                        $resultpage.getPagerLinks().size()*$velocityCount*
[$velocityHasNext]

            #end

 

None of the #if statements recognizes $velocityHasNext.

In the debugging line:

 $resultpage.getPagerLinks().size()*$velocityCount* [$velocityHasNext]

$velocityCount is correctly resolved to the current item count, but
$velocityHasNext is not resolved and is merely rendered as the text
"$velocityHasNext".

 

I tried to explicitly include the following directive in my own
velocity.properties file:

directive.foreach.iterator.name = velocityHasNext

but it made no difference.

 

Grateful for any ideas.

 

Eddie Ridwan

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message