I've changed the binding into:


    <bnd:value id="mydecimal" path="mydecimal/value">
            <bnd:convertor datatype="decimal" type="formatting">
              <bnd:patterns>
                <bnd:pattern>#0</bnd:pattern>
              </bnd:patterns>
            </bnd:convertor>
    </bnd:value>

But still the same output; still I don't understand how the form definition convertor for my date field does work without a convertor in the binding for it (the only difference is that it's an output widget and the decimal is a regular field widget.

Regards,
Gunter

 




Bruno Dumon <[EMAIL PROTECTED]>

26/07/2004 16:50

Please respond to
[EMAIL PROTECTED]

To
[EMAIL PROTECTED]
cc
Subject
Re: Woody convertors: date formatting & decimal formatting





On Mon, 2004-07-26 at 16:27, Gunter D'Hondt wrote:
> I'm just doing simple binding:
> <wd:value id="mydecimal" path="thefield/value" />
>
> The input XML is:
>         <thefield>
>                 <value>30000.0</value>
>         </thefield>
>
> Definition:
>   <wd:field id="mydecimal" required="true">
>     <wd:datatype base="decimal">
>         <wd:convertor>
>           <wd:patterns>
>             <wd:pattern>#0</wd:pattern>
>           </wd:patterns>
>         </wd:convertor>
>     </wd:datatype>
>     <wd:label>Mydecimal:</wd:label>
>   </wd:field>
>
> And I want to display "30000" instead of "30000.0"; same as when input
> is "" (empty) I'd like to display "0".

The convertor defined in the form definition is used to handle the input
from an HTTP request. If conversion needs to happen during the binding,
the convertor has to be specified as part of the binding definition.

See also the description for fb:value at
http://cocoon.apache.org/2.1/userdocs/forms/binding.html

--
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED]                          [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to