You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ugo Cei <ug...@apache.org> on 2004/10/13 17:22:05 UTC

Re: CForms currency convertor

Il giorno 30/set/04, alle 10:32, Daniele Madama ha scritto:

> Hi,
> I have a problem with use of convertor in binding. My application 
> retrieve
> an xml with this tag
>
> <ammount>60.20</ammount>
>
> in my form definition I define this widget
>
> <fd:field id="fromAmount" required="false">
>   <fd:datatype base="decimal"/>
>   <fd:label>
>     <i18n:text>label.Da</i18n:text>
>   </fd:label>
> </fd:field>
>
> and in binding
>
> <fb:value id="fromAmount" path="ammount">
>   <fd:convertor datatype="decimal" type="formatting" 
> variant="currency">
>     <fd:patterns>
>       <fd:pattern locale="it_IT">###,##0.00</fd:pattern>
>     </fd:patterns>
>   </fd:convertor>
> </fb:value>
>
> This don't work fine, after load of form the associated input is 
> empty; if
> I remove "locale" attribue It work, but not in the format that I want.

Why did you put the convertor element in the binding? Have you tried 
putting it in the definition? I'm not even sure if defining it in the 
binding is supposed to work, but I might be wrong, I'm no CForms guru 
;-)

	Ugo

-- 
Ugo Cei - http://beblogging.com/

Re: CForms currency convertor

Posted by Jan Hoskens <jh...@schaubroeck.be>.
If your given xml tag is to be binded to your form, the convertor is in 
the right place.
If I remember correctly the convertors may be seen as follows:
Convertor in binding -> datasource is in specified format
Convertor in definition -> input in browser is in specified format

Try <fd:pattern locale="it-IT"> , notice the "-" instead of "_".
Then you should get the same result as when you leave the locale 
attribute out.
I'm not sure what you mean by your last sentence

<snip>
I remove "locale" attribue It work, but not in the format that I want.
</snip>

How do you mean "It work" but not in your wanted format?

Kind Regards,
Jan

Ugo Cei wrote:

> Il giorno 30/set/04, alle 10:32, Daniele Madama ha scritto:
>
>> Hi,
>> I have a problem with use of convertor in binding. My application 
>> retrieve
>> an xml with this tag
>>
>> <ammount>60.20</ammount>
>>
>> in my form definition I define this widget
>>
>> <fd:field id="fromAmount" required="false">
>>   <fd:datatype base="decimal"/>
>>   <fd:label>
>>     <i18n:text>label.Da</i18n:text>
>>   </fd:label>
>> </fd:field>
>>
>> and in binding
>>
>> <fb:value id="fromAmount" path="ammount">
>>   <fd:convertor datatype="decimal" type="formatting" variant="currency">
>>     <fd:patterns>
>>       <fd:pattern locale="it_IT">###,##0.00</fd:pattern>
>>     </fd:patterns>
>>   </fd:convertor>
>> </fb:value>
>>
>> This don't work fine, after load of form the associated input is 
>> empty; if
>> I remove "locale" attribue It work, but not in the format that I want.
>
>
> Why did you put the convertor element in the binding? Have you tried 
> putting it in the definition? I'm not even sure if defining it in the 
> binding is supposed to work, but I might be wrong, I'm no CForms guru ;-)
>
>     Ugo
>


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