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'.

0 votes

1 answers

2158 views

ANSWER

Can you add more information please? What's the schema's type? how you declare the layout? in what moment you get the error?
05/30/2014

More Info as Requested!!!

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" />

&lt;xs:element name=&quot;managers&quot; type=&quot;nxs:stringArrayType&quot; /&gt;
&lt;xs:simpleType name=&quot;stringArrayType&quot;&gt;
    &lt;xs:list itemType=&quot;xs:string&quot; /&gt;
&lt;/xs:simpleType&gt;  

</xs:schema>

2.)The core-contrib.xml

<?xml version="1.0"?> <component name="unit.core.types">

<extension target="org.nuxeo.ecm.core.schema.TypeService"

point=&quot;schema&quot;&gt;
&lt;schema name=&quot;unit&quot; src=&quot;schemas/unit.xsd&quot;
  prefix=&quot;unit&quot; /&gt;

</extension>

<extension target="org.nuxeo.ecm.core.schema.TypeService"

point=&quot;doctype&quot;&gt;
&lt;facet name=&quot;Unit&quot;&gt;
  &lt;schema name=&quot;unit&quot; /&gt;
&lt;/facet&gt;

&lt;doctype name=&quot;Unit&quot; extends=&quot;Document&quot;&gt;
  &lt;schema name=&quot;common&quot; /&gt;
  &lt;schema name=&quot;dublincore&quot; /&gt;
  &lt;facet name=&quot;Unit&quot; /&gt;
  &lt;facet name=&quot;HiddenInNavigation&quot; /&gt;
&lt;/doctype&gt;

</extension>

</component>

3.)layout-contrib.xml

<component name="unit.layout">

&lt;require&gt;org.nuxeo.ecm.platform.forms.layouts.webapp&lt;/require&gt;

&lt;extension target=&quot;org.nuxeo.ecm.platform.forms.layout.WebLayoutManager&quot;
    point=&quot;widgets&quot;&gt;

    &lt;widget name=&quot;unit_code&quot; type=&quot;text&quot;&gt;
        &lt;labels&gt;
            &lt;label mode=&quot;any&quot;&gt;Unit ID&lt;/label&gt;
        &lt;/labels&gt;
        &lt;translated&gt;true&lt;/translated&gt;
        &lt;fields&gt;
            &lt;field&gt;code&lt;/field&gt;
        &lt;/fields&gt;
        &lt;properties widgetMode=&quot;edit&quot;&gt;
            &lt;property name=&quot;styleClass&quot;&gt;dataInputText&lt;/property&gt;
        &lt;/properties&gt;
    &lt;/widget&gt;

    &lt;widget name=&quot;unit_description&quot; type=&quot;textarea&quot;&gt;
        &lt;labels&gt;
            &lt;label mode=&quot;any&quot;&gt;Description&lt;/label&gt;
        &lt;/labels&gt;
        &lt;translated&gt;true&lt;/translated&gt;
        &lt;fields&gt;
            &lt;field&gt;description&lt;/field&gt;
        &lt;/fields&gt;
        &lt;properties widgetMode=&quot;edit&quot;&gt;
            &lt;property name=&quot;styleClass&quot;&gt;dataInputText&lt;/property&gt;
        &lt;/properties&gt;
    &lt;/widget&gt;
    &lt;widget name=&quot;unit_managers&quot; type=&quot;multipleUsersSuggestion&quot;&gt;
        &lt;labels&gt;
            &lt;label mode=&quot;any&quot;&gt;Unit Managers&lt;/label&gt;
        &lt;/labels&gt;
        &lt;translated&gt;true&lt;/translated&gt;
        &lt;fields&gt;
            &lt;field&gt;managers&lt;/field&gt;
        &lt;/fields&gt;
        &lt;properties widgetMode=&quot;edit&quot;&gt;
            &lt;property name=&quot;styleClass&quot;&gt;dataInputText&lt;/property&gt;
        &lt;/properties&gt;
    &lt;/widget&gt;
&lt;/extension&gt;

&lt;extension target=&quot;org.nuxeo.ecm.platform.forms.layout.WebLayoutManager&quot;
    point=&quot;layouts&quot;&gt;

    &lt;layout name=&quot;unit_layout&quot;&gt;
        &lt;templates&gt;
            &lt;template mode=&quot;any&quot;&gt;/layouts/layout_default_template.xhtml
            &lt;/template&gt;
        &lt;/templates&gt;

        &lt;rows&gt;
            &lt;row&gt;
                &lt;widget&gt;unit_code&lt;/widget&gt;
            &lt;/row&gt;
            &lt;row&gt;
                &lt;widget&gt;unit_description&lt;/widget&gt;
            &lt;/row&gt;
            &lt;row&gt;
                &lt;widget&gt;unit_managers&lt;/widget&gt;
            &lt;/row&gt;
        &lt;/rows&gt;
    &lt;/layout&gt;
    &lt;/extension&gt;

</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>

&lt;h:outputText value=&quot;#{messages[&apos;title.create.unit&apos;]}&quot; /&gt;

</h3>

<a4j:form id="createUnit">

&lt;script&gt;
  jQuery(document).ready(function() {
    jQuery(&apos;#createUnitView\\:createUnit&apos;).focusFirst();
  });
&lt;/script&gt;
&lt;nxl:layout name=&quot;unit_layout&quot; mode=&quot;create&quot; value=&quot;#{clientManagementActions.newUnit}&quot; /&gt;
&lt;table class=&quot;dataInput&quot;&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        &lt;a4j:commandButton
          id=&quot;button_save_and_create&quot;
          value=&quot;#{messages[&apos;command.saveAndCreate&apos;]}&quot;
          action=&quot;#{clientManagementActions.createUnit(true)}&quot;
          styleClass=&quot;button&quot;
          reRender=&quot;unitPanel,facesStatusMessagePanel&quot; /&gt;
        &lt;a4j:commandButton
          id=&quot;button_save&quot;
          value=&quot;#{messages[&apos;command.save&apos;]}&quot;
          action=&quot;#{clientManagementActions.createUnit}&quot;
          styleClass=&quot;button&quot;
          reRender=&quot;unitPanel,facesStatusMessagePanel&quot; /&gt;
        &lt;a4j:commandButton
          immediate=&quot;true&quot;
          value=&quot;#{messages[&apos;command.cancel&apos;]}&quot; styleClass=&quot;button&quot;
          reRender=&quot;unitPanel&quot; /&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

</a4j:form>

</div>

05/30/2014



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>
0 votes



Thanks a lot for the help. Nonetheless, I keep getting property not found warning after modifying to your suggestion. Such warnings are :

[DocumentModelResolver] Property not found: unit:code [DocumentModelResolver] Property not found: unit:description [DocumentModelResolver] Property not found: unit:managers

05/30/2014

Why do you declare the schema inside a Facetand then the facet inside the document? Try declaring the schema direct in the document: &lt;doctype name=&quot;Unit&quot; extends=&quot;Document&quot;&gt; &lt;schema name=&quot;common&quot; /&gt; &lt;schema name=&quot;dublincore&quot; /&gt; &lt;schema name=&quot;unit&quot; /&gt; &lt;!-- Here --&gt; &lt;facet name=&quot;HiddenInNavigation&quot; /&gt; &lt;/doctype&gt;
05/30/2014

The warning is still there after I modified to this

<component name="unit.core.types">

<extension target="org.nuxeo.ecm.core.schema.TypeService"

point=&quot;schema&quot;&gt;
&lt;schema name=&quot;unit&quot; src=&quot;schemas/unit.xsd&quot;
  prefix=&quot;unit&quot; /&gt;

</extension>

<extension target="org.nuxeo.ecm.core.schema.TypeService"

point=&quot;doctype&quot;&gt;

&lt;doctype name=&quot;Unit&quot; extends=&quot;Document&quot;&gt;
  &lt;schema name=&quot;common&quot; /&gt;
  &lt;schema name=&quot;dublincore&quot; /&gt;
  &lt;schema name=&quot;unit&quot; /&gt;
  &lt;facet name=&quot;HiddenInNavigation&quot; /&gt;
&lt;/doctype&gt;

</extension>

</component>

05/30/2014

And how are you declaring the relationship between your document and the layouts?
05/30/2014

<nxl:layout name="unit_layout" mode="create" value="#{clientManagementActions.newUnit}"/>

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();

05/30/2014

Thanks a bunch LEANARDO!

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.

05/30/2014