cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Sparkes <pe...@didm.co.uk>
Subject Re: CFORMS: datatype - formatting (decimal) - Solved
Date Sat, 08 Apr 2006 12:58:36 GMT
Hi Simone,

Thanks very much - works perfectly

Peter

> Hi Peter,
> just use :
>
> <fd:datatype base="integer">
>  <fd:convertor type="plain"/>
> </fd:datatype>
>
> If you have a big application, with many integer fields, an you want 
> all of them to use the plain convertor without having to type 
> <fd:convertor type="plain"/> every time, you could also consider 
> changing your cocoon.xconf file to use "plain" as the default 
> convertor for integer type, changing this lines :
>
>      <datatype name="integer" 
> src="org.apache.cocoon.forms.datatype.typeimpl.IntegerTypeBuilder">
>        <convertors default="formatting" plain="plain">
>
> to this :
>
>      <datatype name="integer" 
> src="org.apache.cocoon.forms.datatype.typeimpl.IntegerTypeBuilder">
>        <convertors default="plain" plain="plain">
>
> It's a bit untidy (because your application will rely on a custom 
> cocoon configuration) but could save a lot of time.
>
> Simone
>
> Peter Sparkes wrote:
>
>> HI,
>>
>> I am using CForms to amend xml documents. I have several field 
>> widgets with datatype 'integer'. The default formatting for integer 
>> is of the form '1,234,567,890'. I need to change the formatting to 
>> '1234567890'.
>>
>> In my binding file I am using for example
>>
>>  <fb:value id="lodgeNumber" path="@no" >
>>      <fd:convertor type="formatting"  datatype="integer" >
>>          
>> <fd:patterns><fd:pattern>############</fd:pattern></fd:patterns>
>>      </fd:convertor>
>>  </fb:value>
>>
>> On loading a document with attribute no="1234567890" I still get 
>> '1,234,567,890' in the Form, however, when saving the amended form it 
>> works correctly and I get no="1234567890" in the xml doc. If I change 
>> the ####### to for example ##,##,##,##,## the form still gives 
>> '1,234,567,890', however, the saved xml correctly  reflects  the new 
>> pattern eg 12,34,56,78,90
>>
>> Please, how do I get the format '1234567890' in the CForm
>>
>> Peter Sparkes
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>

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


Mime
View raw message