You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2004/07/27 13:10:12 UTC

SOLVED Re: Integer formatting [was Re: Woody convertors: dateformatting&decimal formatting]

Thanks Bruno

I was missing the fact that I need a 
<fd:convertor datatype="integer" type="plain"/>
in BOTH the form model and binding files...

Derek

>>> bruno@outerthought.org 2004/07/27 12:27:07 PM >>>
On Tue, 2004-07-27 at 11:58, Derek Hohls wrote:
> Bruno
> 
> I have tried the same:
> 
>     <fd:field id="number" required="true">
>       <fd:label>Select a number:</fd:label>
>       <fd:datatype base="integer"><fd:convertor datatype="integer"
> type="plain"</fd:datatype>
>       <!--
>       <fd:selection-list>
>         <fd:item value="1"/>
>         <fd:item value="2"/>
>         <fd:item value="3"/>
>         <fd:item value="4"/>
>         <fd:item value="5"/>
>       </fd:selection-list>
>       -->
>     </fd:field>
> 
> and I still get the "," ... could this be a locale setting problem?

No, since the plain convertor does simply String.valueOf(...), which
is
locale insensitive.

> 
> I am using Cocoon 2.1.5; the "stable" version.  Could you
> check this issue on the same version?

Sorry, no time for that right now, maybe later today.

However, I'm now confused again because you posted that particular XML
snippet and added type="plain" in it (and also because it's not even
well-formed XML). Note that this was not necessary, the type="plain"
needs to be in the binding:

    <!-- jxpath binds to nodes as well as to attributes -->
    <fb:value id="number" path="number/@value">
      <!-- for non-string datatypes, a convertor must be specified.
These are
      the same convertors as can be used in form definitions, but
require an
      extra datatype attribute. Here we use the default convertor for
longs. -->
      <fd:convertor datatype="integer" type="plain"/>
    </fb:value>

Just to be sure, could you confirm you did this also?

-- 
Bruno Dumon                             http://outerthought.org/ 
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org 


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


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


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