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