You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Michael Osipov (JIRA)" <de...@velocity.apache.org> on 2010/08/27 10:31:52 UTC
[jira] Commented: (VELOCITY-762) $foreach.first and $foreach.last
do not have assigned values
[ https://issues.apache.org/jira/browse/VELOCITY-762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903288#action_12903288 ]
Michael Osipov commented on VELOCITY-762:
-----------------------------------------
I'd like to remark that the last last value is incorrect. More over as you can see in my ticket VELOCITY-772 hasNext is always true, which is oncorrect. That's why isLast() fails.
> $foreach.first and $foreach.last do not have assigned values
> ------------------------------------------------------------
>
> Key: VELOCITY-762
> URL: https://issues.apache.org/jira/browse/VELOCITY-762
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.7-beta1
> Reporter: Sergiy Kovalchuk
> Fix For: 1.7, 2.0
>
>
> $foreach.first and $foreach.last are not getting assigned in a loop (while isFirst() and isLast() do) .
> Test case:
> #foreach($i in [1..3])
> index = $foreach.index,
> count = $foreach.count,
> first = $foreach.isFirst() / $foreach.first,
> last = $foreach.isLast() / $foreach.last<br/>
> #end
> Result:
> index = 0, count = 1, first = true / $foreach.first, last = false / $foreach.last
> index = 1, count = 2, first = false / $foreach.first, last = false / $foreach.last
> index = 2, count = 3, first = false / $foreach.first, last = false / $foreach.last
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org