Hubert Trzewik wrote:
I found a problem with binding data to woody form.

Example:
In this example binding works perfectly..

XML data for binding:
<MyFactor>55</MyFactor>

Form definition:
<wd:field id="myfactor">
  <wd:label>My facor:</wd:label>
  <wd:datatype base="string"/>
</wd:field>

But if we change datatype in definition to
<wd:datatype base="float"/>
error shows up, that Cocoon expected float data and it recived string type..

Of course it's a string which should be parsed into float, but it's not.
Why? Is it my fault?


value-binding allows for specifying a string-to/from-datatype convertor:


<wb:value id="myfactor" path="MyFactor">
  <wd:convertor datatype="float" />
</wb:value>

this will require you to also declare the wd namespace

this convertor will be used to transform your datatype back to a string for the XML backend.

see:
- http://wiki.cocoondev.org/Wiki.jsp?page=WoodyBinding
- http://wiki.cocoondev.org/Wiki.jsp?page=WoodyDatatypeReference

HTH
-marc=


Please someone check it or give an advice (if it's my falut). Maybe it's a case for Bugzilla.

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


-- Marc Portier http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center Read my weblog at http://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED]

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



Reply via email to