Bruno,
The date formatting is ok, but the decimal is still not working (has nothing to do with the formatting); error is:

java.lang.RuntimeException: Incorrect value type for "mydecimal" (expected class java.math.BigDecimal, got class java.lang.String.

I'm sure that the input is "1000.0" which should be accepted by the constructor java.math.BigDecimal(java.lang.String)
Any idea?

Regards,
Gunter D'Hondt
SOFICO NV Belgium.



Bruno Dumon <[EMAIL PROTECTED]>

26/07/2004 13:05

Please respond to
[EMAIL PROTECTED]

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





On Mon, 2004-07-26 at 12:08, Gunter D'Hondt wrote:
> 1) date formatting:
>
> In my form definition I've got the following:
>
>   <wd:output id="mydate">
>     <wd:datatype base="date"/>
>     <wd:label/>
>     <wd:convertor type="formatting">
>       <wd:patterns>
>         <wd:pattern>dd-MM-yyyy</wd:pattern>
>       </wd:patterns>
>     </wd:convertor>
>   </wd:output>        
>
> The input from the binding is "1900-01-01 00:00:00" but the outcome
> (in the browser) is always: 1/1/00
>
> 2) decimal formatting:
>
> Same for a decimal:
>
>   <wd:field id="mydecimal">
>     <wd:datatype base="decimal"/>
>     <wd:label/>
>         <wd:convertor type="formatting" variant="integer">
>           <wd:patterns>
>             <wd:pattern>#0</wd:pattern>
>           </wd:patterns>
>         </wd:convertor>
>   </wd:field>
>
> Input is: 1000.0 and outcome is again 1000.0 instead of 1000.
>
> Any help is welcome,

The convertor elements should be moved into the datatype elements:

   <wd:datatype base="decimal">
       <wd:convertor type="formatting" variant="integer">
         <wd:patterns>
           <wd:pattern>#0</wd:pattern>
         </wd:patterns>
       </wd:convertor>
   </wd:datatype>

--
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