[m1] How to access a list element

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[m1] How to access a list element

Jens Zastrow
I found this in the docs:

 

<j:forEach items="${goals}" var="goal" indexVar="goalNumber">
   Now attaining goal number ${goalNumber}, which is ${goal}
   <attainGoal name="${goal}" />
</j:forEach>

 

I need something like:

 

${goals[index]}

 

Thanks

Jens

 

Reply | Threaded
Open this post in threaded view
|

Re: [m1] How to access a list element

Brett Porter
If goals is a list (not a collection), ${goals.get(index)} should work

On 5/28/05, Jens Zastrow <[hidden email]> wrote:

> I found this in the docs:
>
>
>
> <j:forEach items="${goals}" var="goal" indexVar="goalNumber">
>    Now attaining goal number ${goalNumber}, which is ${goal}
>    <attainGoal name="${goal}" />
> </j:forEach>
>
>
>
> I need something like:
>
>
>
> ${goals[index]}
>
>
>
> Thanks
>
> Jens
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]