You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sanket Pattekar <sa...@gmail.com> on 2006/11/02 14:25:59 UTC
CFORMS fd:selection-list with i18n issue
Hi,
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
Sanket
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: CFORMS fd:selection-list with i18n issue
Posted by Niels van Kampenhout <n....@hippo.nl>.
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