cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <>
Subject Re: HashMap in repeater binding via javascript
Date Fri, 04 Jan 2008 21:03:05 GMT
Dev at weitling pisze:
> Hi Harald,
> thanks for your help, but it I'm sorry to say it doesn't match my problem.
> An example:
>     Map<String,String> locales = new HashMap<String,String>();
>     locales.put("de","deutsch");
>     locales.put("en","english");
>     locales.put("fr","francais");
> I now want a repeater binding iterating over the keys with presenting
> the keys with their values in the template, something like (doesn't work!):
>     <fb:repeater id="localeRepeater" path="locales">
>         <fb:identity>
>            <fb:value id="key" path="key"/>
>         </fb:identity>
>         <fb:on-bind>
>            <fb:value id="value" path="value"/>
>         </fb:on-bind>
>     </fb:repeater>
> Alas, Map defines methods keySet() instead of getKeySet(). entrySet()
> returns a Set with MapEntry-objects with getKey()/getValue(), but it's
> name should be getEntrySet(). *Argh*
> So I have to provide a custom binding via Javascript or Java.

Hi Florian,

Have you tried following:
    <fb:repeater id="localeRepeater" path="locales">
           <fb:value id="key" path="@name"/>
           <fb:value id="value" path="."/>

According to last paragraph of Attributes section of JXPath documentation[1] it may work.


Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message