Marc, your solution looked pretty well, but in fact it does not work, there is probably bug.
A message from erro message screen is: java.lang.RuntimeException: Incorrect value type for "myfactor" (expected class java.lang.Float, got class java.math.BigDecimal. As you can see string from XML is converted but into "decimal" type - don't know why.. ok.. now I found I can use decimal instead of float.. so, anyway, Marc, I found your advice usefull, thank you :) > > > 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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
