cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Scheel <>
Subject RE: Nested repeaters and binding
Date Tue, 23 Oct 2007 13:53:38 GMT
Hi Ron,

I also searched a lot of time and found an example in the cocoon(2.1.10) 
distribution (heavy-binding.xml).

Here is a concrete example (using beans as data model):

<fd:repeater id="customers">
        <fd:output id="customerId">
            <fd:datatype base="integer"/>
        <!-- the nested repeater definition -->
        <fd:repeater id="orders">
                <fd:output id="orderId">
                    <fd:datatype base="integer"/>
                <!-- additional order fields -->
        <!-- additional customer fields -->


<!-- suppose you have a data model bean with a method named 
'getCustomers()' that returns a collection of Customers -->
<fb:repeater id="customers" parent-path="." row-path="customers">
       <fb:value id="customerId" path="id" />
       <!-- suppose your data model bean 'Customer' has a method named 
'getOrders()' that returns a collection of Orders -->
       <fb:repeater id="orders" parent-path="." row-path="orders">
             <fb:value id="orderId" path="id" />


<ft:repeater id="customers">
                <jx:when test="${repeater.getSize() == 0}">
                  <tr><td>no customers</td></tr>
                         <ft:widget id="customerId"/>
                         <ft:repeater id="orders">
                             <!-- layout the nested repeater -->  

> Hi All
> I have a requirement to nest repeaters as follows:
> A summary page displays a list of customers.
> Each customer has a list of current orders.
> I want to list the companies, each having a table of orders. I am 
> using the binding framework to display the page. The current 
> requirement is read only, but I suspect that the correct answer will 
> cover editable fields as well. Does anyone have an example on exactly 
> how to do this? A search of the Cocoon site suggests that this is 
> possible, but does not give a definitive example. What I need is XML 
> snippets from a sample page_template.xml, page.xml and page_bind.xml 
> files.
> Any help much appreciated.
> Regards
> Ron
Oliver Scheel
Software Engineer

Wazap AG
Karl-Liebknecht-Str. 5
D-10178 Berlin (Mitte)
URL: /

Winner of the prestigious 2007 Red Herring Europe 100 award

Sitz:         Berlin (HRB 103534 B, Amtsgericht Berlin-Charlottenburg)
Vorstand:     Andreas Rührig (VV), Timo Meyer, Alexander Piutti, Philip
Aufsichtsrat: Martin Sinner (Vors.), Frank Böhnke, Florian Seubert, Markus Jorquera Imbernón

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

View raw message