i keep getting this error: Conversion Error setting value '' for 'null Converter'. on form submit
I added a new schema following nuxeo documentation, defined the layout used to render this schema's document model but i keep getting this error on form submit: Conversion Error setting value '' for 'null Converter'.
the problem is in the widget's definition, you have to put the property with his schema prfix: prefix:property
in yout case that will be:
<widget name="unit_code" type="text">
<labels>
<label mode="any">Unit ID</label>
</labels>
<translated>true</translated>
<fields>
<field>unit:code</field> <!-- here you have to change -->
</fields>
<properties widgetMode="edit">
<property name="styleClass">dataInputText</property>
</properties>
</widget>
[DocumentModelResolver] Property not found: unit:code [DocumentModelResolver] Property not found: unit:description [DocumentModelResolver] Property not found: unit:managers
<doctype name="Unit" extends="Document"> <schema name="common" /> <schema name="dublincore" /> <schema name="unit" /> <!-- Here --> <facet name="HiddenInNavigation" /> </doctype>
<component name="unit.core.types">
<extension target="org.nuxeo.ecm.core.schema.TypeService"
point="schema">
<schema name="unit" src="schemas/unit.xsd"
prefix="unit" />
</extension>
<extension target="org.nuxeo.ecm.core.schema.TypeService"
point="doctype">
<doctype name="Unit" extends="Document">
<schema name="common" />
<schema name="dublincore" />
<schema name="unit" />
<facet name="HiddenInNavigation" />
</doctype>
</extension>
</component>
The layout name is as defined earlier above where newUnit() returns a new created document model thus:
DocumentModel document = session.createDocumentModel("Unit"); document = session.createDocument(document);
DocumentRef documentRef = document.getRef(); ACP acp = session.getACP(documentRef); ACL acl = acp.getOrCreateACL(); acl.add(new ACE(EVERYONE, READ, true)); acp.addACL(acl); session.setACP(documentRef, acp, true); session.save();
In trying to find out the major cause of the <<<< Conversion Error setting value '' for 'null Converter' >>>>, I removed the prefix="unit" attribute on the unit schema component and reverted to <field>code</field>. The layout got rendered correct without the property not found warning. This did solve the warning but the conversion error still remained.
My question is this, do I have to implement any jsf converter to handle this or does nuxeo provide ways of handling this. Please I will appreciate anyone's help and demo links on how this works.
Thanks in advance.
1.)The schema definition
<?xml version="1.0"?> <xs:schema targetNamespace="http://www.nuxeo.core/ecm/schemas/unit/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:nxs="http://www.nuxeo.core/ecm/schemas/unit/">
<xs:include schemaLocation="core-types.xsd" />
<xs:element name="code" type="xs:string" /> <xs:element name="description" type="xs:string" />
</xs:schema>
2.)The core-contrib.xml
<?xml version="1.0"?> <component name="unit.core.types">
<extension target="org.nuxeo.ecm.core.schema.TypeService"
</extension>
<extension target="org.nuxeo.ecm.core.schema.TypeService"
</extension>
</component>
3.)layout-contrib.xml
<component name="unit.layout">
</component>
4.)unit.xhtml <div xmlns:h="http://java.sun.com/jsf/html" xmlns:nxl="http://nuxeo.org/nxforms/layout" xmlns:nxh="http://nuxeo.org/nxweb/html" xmlns:a4j="http://richfaces.org/a4j">
<h3>
</h3>
<a4j:form id="createUnit">
</a4j:form>
</div>