You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by defe <de...@free.fr> on 2004/09/24 12:39:05 UTC

jxtemplate - HashMap

hi,
    does someone know how to iterate over the keys of an HashMap and
retrieve the values in a jxtemplate?

<jx:forEach var="key" items="${map.keySet()}">
    <value>${map.get(key)}</value>    <!-- how to pass 'key' as a 
parameter to get() here? -->
 </jx:forEach>

regards


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: jxtemplate - HashMap

Posted by Robin Wyles <ro...@robinwyles.com>.
Defe,

On 24 Sep 2004, at 12:39, defe wrote:

> <jx:forEach var="key" items="${map.keySet()}">
>    <value>${map.get(key)}</value>    <!-- how to pass 'key' as a 
> parameter to get() here? -->
> </jx:forEach>

This works fine for me, but I wonder if your map is referenced 
correctly? Maybe it should be bean.map or something? Personally I set 
my map as a variable first because I use it in various places in the 
pages...

<jx:set var="map" value="${bean.map}"/>

Robin


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org