cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Duroc <>
Subject Ajax & add-row
Date Tue, 25 Jul 2006 15:19:40 GMT

I have a binding form to edit XML files, and I would like to propose to users 
the possibility to add elements (XML node), I tried to use ajax and the 
repeater-action to add node. The  mecanism works, but not with ajax events. 
The page is entirely reloaded when I click on the "add" bouton, and the URL 
page changes (with id continuation).

I enabled ajax (="true") in the form-template. In the sitemap, there is the 
pattern using "jx" generate. I really don't know where the miss is :/

here is a part of my binding xml file :
<fb:repeater id="essais" parent-path="." row-path="essai">
        <fb:value id="date" path="date" />
        <fb:value id="heure" path="heure" />
        <fb:value id="lieu" path="lieu" />
        <fb:value id="Nom" path="nom" />

the model xml file :
<fd:repeater id="matchs">
        <fd:booleanfield id="select" />
        <fd:field id="date">
            <fd:datatype base="string" />
        <fd:field id="heure">
            <fd:datatype base="string" />
        <fd:field id="lieu">
            <fd:datatype base="string" />
        <fd:field id="receveur">
            <fd:datatype base="string" />
        <fd:field id="nom">
            <fd:datatype base="string" />
        <fd:field id="visiteur">
            <fd:datatype base="string" />
        <fd:field id="score_visiteur">
            <fd:datatype base="string" />
<fd:repeater-action id="addEssai" command="add-row" repeater="essais">
<fd:repeater-action id="remove" command="delete-rows" repeater="essais" 

the sitemap : 
<map:match pattern="*-*-display-pipeline.jx">
    <map:generate type="jx" src="/{1}/{2}_template.xml" />
    <map:transform type="browser-update"/>
    <map:transform type="forms" label="content1"/>
    <map:transform type="i18n">
        <!--map:parameter name="locale" value="en-US"/-->
    <map:call resource="simple-page2html">
        <map:parameter name="file" value="/{1}/{2}_template.xml"/>
    <map:transform src="resources/forms-samples-styling.xsl">
        <map:parameter name="resources-uri" 
    <map:select type="ajax-request">
        <map:when test="true">
           <map:serialize type="xml"/>
           <map:serialize type="html"/>

and the template :
<page xmlns:ft=""
    <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-
<ft:form-template action="#{$cocoon/continuation/id}.continue.form3" 
method="POST" ajax="true">
<ft:repeater id="essais">
                    <td width="20px">
                        <ft:widget id="select"><fi:styling 
class="checkbox" /></ft:widget>
                    <th align="left"><ft:widget-label id="date" /> :</th>
                    <td><ft:widget id="date" /></td>
                    <th align="left"><ft:widget-label id="heure" /> :</th>
                    <td><ft:widget id="heure" /></td>
                    <th align="left"><ft:widget-label id="lieu" /> :</th>
                    <td><ft:widget id="lieu" /></td>
            <br />
<ft:widget id="addEssai">
    <fi:styling class="bouton"/>
<ft:widget id="removeEssai">
    <fi:styling class="bouton"/>

If anyone has an idea...

Thanks in advance,


Nicolas Duroc

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message