Hi.
I`m trying to bind simple XML file to Cocoon(2.2) Forms, but I have problems with setting repeater to show content of my file. After I ran application server threw error :

java.lang.RuntimeException: org.apache.cocoon.forms.binding.ValueJXPathBinding (file:///C:/maven/XmlInsert/./src/main/resources/COB -INF/resource/internal/forms/project_binding.xml:12:34): Widget "id" does not exist in the container "projects.0" (<fd:repeater> - cocoon://re
source/internal/forms/project_model.xml:5:32).

Here is content of my xml file :

<?xml version="1.0" encoding="UTF-8" ?>
<projects>
   <project>
       <id>0</id>
       <title>Projekt #1</title>
       <description>Opis projektu #1</description>
       <pdfLink>Pdf link #1</pdfLink>
</project> <project>
       <id>1</id>
       <title>Projekt #2</title>
       <description>Opis projektu #2</description>
       <pdfLink>Pdf link #2</pdfLink>
</project> </projects>


projects_binding.xml :

<?xml version="1.0" ?>

<fb:context
   id="form"
   xmlns:fb="http://apache.org/cocoon/forms/1.0#binding";
   xmlns:fd="http://apache.org/cocoon/forms/1.0#definition";
   path="/" >
<fb:repeater id="projects" parent-path="projects" row-path="project"> <fb:identity>
           <fb:value id="id" path="id" />
       </fb:identity>
       <fb:on-bind>
           <fb:value id="title" path="title" />
           <fb:value id="description" path="description" />
           <fb:value id="pdfLink" path="pdfLink" />
</fb:on-bind> </fb:repeater> </fb:context>

Piepeline:

<map:match pattern="editproject">
         <map:call function="editproject">
             <map:parameter name="function" value="{0}"/>
<map:parameter name="documentURI" value="resource/internal/projects2.xml" /> <map:parameter name="bindingURI" value="resource/internal/forms/project_binding.xml"/>
         </map:call>
</map:match>


Flowscript :

function editproject()
{
var form = new Form("cocoon://resource/internal/forms/project_model.xml"); var bindUri = cocoon.parameters.bindingURI;
   form.createBinding(bindUri);
var docUri = cocoon.parameters.documentURI;
   var document = loadDocument(docUri);
form.load(document);
   form.showForm("editproject-display-pipeline");
}

Any advice will be appreciated. Thank you.

Regards,
Tomasz




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

Reply via email to