cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niels van Kampenhout <n.vankampenh...@hippo.nl>
Subject Re: CFORMS fd:selection-list with i18n issue
Date Thu, 02 Nov 2006 13:54:24 GMT
Hi Sanket,

Sanket Pattekar wrote:
> I am using CForms with cocoon 2.1.8. My condition is that I need to
> generate a fd:selection-list whose values are also i18n keys. I use
> the following code to populate the combo box
> 
> <fd:field id="title" required="true">
>      <fd:label>Title:</fd:label>
>      <fd:datatype base="string"/>
>      <fd:selection-list nullable="false">
>          <fd:item value="mister" i18n:attr="value"
> i18n:catalogue="other"><fd:label><i18n:text
> i18n:catalogue="other">mister</i18n:text></fd:label></fd:item>
>          <fd:item value="mrs" i18n:attr="value"
> i18n:catalogue="other"><fd:label><i18n:text
> i18n:catalogue="other">mrs</i18n:text></fd:label></fd:item>
>      </fd:selection-list>
>    </fd:field>
> 
> In the drop down I see proper i18n values, but when I do view source
> then I see the following
> 
> <select name="newprofile.title" id="newprofile.title:input" title="">
> <option value="mister">Mr.</option>
> <option value="mrs">Mrs.</option>
> </select>
> 
> i.e the i18n keys for values are not getting replaced.
> 
> Is there any thing that I am doing wrong

I think the problem is that the i18n transformer is not directly applied 
to this piece of XML, but later in this or another pipeline. I would 
have to see your sitemaps to be able to see what the exact problem is.

A simple solution that is guaranteed to work though is to use a separate 
pipeline to generate the options of the selection list, like this:

<fd:selection-list src="cocoon:/mychoices.xml" dynamic="true"/>

See [1] for documentation and examples.

Regards,
Niels

[1] http://cocoon.apache.org/2.1/userdocs/widgetconcepts/selectionlists.html


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


Mime
View raw message