You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Noureddine BEKRAR <nb...@rennes.jouve.fr> on 2004/07/22 11:55:10 UTC

MultiValueField's binding problem

Hi,

I have a very complicated problem with multivaluesfield's binding:
All is ok when i load the bean, but when i try to save the form i have this error message:

 org.apache.commons.jxpath.JXPathException: Exception trying to create xpath modulesIDsList[1]; Factory is not set on the JXPathContext - cannot create path: /modulesIDsList[1] 



this is my binding file :

<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding" path="/" >

<fb:multi-value id="listModules" parent-path="." row-path="modulesIDsList" / >

</fb:context>

this is the bean:

public class MyBean{
     Collection modulesIDsList= new Vector();

 public Collection getModulesIDsList() {
            return modulesIDsList;
       }
    public void setModulesIDsList(Collection modulesIDsList) {
            this.modulesIDsList = modulesIDsList;
       }

}

and this is the defenition file:

....

<fd:multivaluefield id="listModules" required="true">

<fd:label>Modules :</fd:label>

<fd:datatype base="string">


</fd:datatype>

<fd:selection-list type="flow-jxpath" list-path="modulesList" 

value-path="value" label-path="label" />

</fd:multivaluefield>

....

I think  when the binding framework loads the bean he wants a Collection type for the modulesIDsList field but when he save he wants a Object[] type field.



This probleme exist in the mail archive list but there is no solution in the thread.

(http://archives.real-time.com/pipermail/cocoon-users/2004-April/049643.html)

What do you think about that?

Noureddine