Rice Yeh wrote:
By reading the source code of cocoon-template-impl, I find it suports javascript expression. So I can use javascript to new java.util.Locale instance as the following:

<?xml version="1.0"?>
<fd:selection-list xmlns:fd=" http://apache.org/cocoon/forms/1.0#definition";
xmlns:jx="http://apache.org/cocoon/templates/jx/1.0 <http://apache.org/cocoon/templates/jx/1.0>">
  <jx:set var="locale"
value="@{new Packages.java.util.Locale(cocoon.get('parameters').get('language'), cocoon.get('parameters').get('country'))}"/> <jx:forEach var="country" items="${ Packages.as.party.Country.countries()}">
    <fd:item value="${country.iso3166Code}">
    <fd:label>${country.toString(locale)}</fd:label>
    </fd:item>
  </jx:forEach>
</fd:selection-list>
yes you can. You could probably do the same with Jexl by:

${Packages.java.util.Locale( cocoon.parameters.language, cocoon.parameters.country )}

--
Leszek Gawron, IT Manager                          MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Reply via email to