cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorg Heymans ...@domek.be>
Subject Re: CForms - load / save to different targets
Date Fri, 24 Sep 2004 09:01:51 GMT
> 
> <fb:value id="widget" path="context1" direction="load"/>
> <fb:value id="widget" path="context2" direction="save"/>

this does not seem to work for me (using javascript binding becaues of 
multivaluefield)

the loading works but in the saving it says that it "can't create path 
/selectedGroups" although there *is* a selectedGroups member var 
(Arraylist) with proper get and set methods for it.
Does the context of the load binding change the global context maybe so 
i need to make my save binding relative to the load (tried that actually 
without success)

   <fb:javascript id="targetgroups" path="profile/baseTargetGroups" 
direction="load">
     <fb:load-form>
      var collection = jxpathPointer.getNode();
      widget.setSelectionList(collection, "id", "name");
     </fb:load-form>
   </fb:javascript>

   <fb:javascript id="targetgroups" path="selectedGroups" direction="save">
     <fb:save-form>
       var formValue = widget.getValue();
       var collection = new java.util.ArrayList();
       for(var i=0; i&lt;formValue.length; i++) {
         collection.add(new java.lang.Integer(formValue[i]));
       }
       var node = jxpathPointer.getNode();
       node.setValue(collection);
       //tried this with jxpathPointer.setValue(collection) as well
     </fb:save-form>


Original Exception: org.apache.commons.jxpath.JXPathException: Exception 
trying to create xpath selectedGroups; Factory is not set on the 
JXPathContext - cannot create path: /selectedGroups
         at 
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(JXPathContextReferenceImpl.java:420)
         at 
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.createPath(JXPathContextReferenceImpl.java:397)
         at 
org.apache.cocoon.forms.binding.JavaScriptJXPathBinding.doSave(JavaScriptJXPathBinding.java:90)
         at 
org.apache.cocoon.forms.binding.JXPathBindingBase.saveFormToModel(JXPathBindingBase.java:187)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message