cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <>
Subject [CForms] Repeater with links
Date Mon, 27 Jun 2005 13:59:24 GMT
Here's a simple problem for which I cannot seem to find a simple 
solution (or any solution at all). I hope someone here can help me.

I have a Collection of Java beans. Each bean has a couple of 
properties: "id" (Integer) and "name" (String).

I also have a form with a repeater:

     <fd:repeater id="current">
         <fd:output name="id" id="id">
           <fd:datatype base="integer"/>
         <fd:output id="name">
           <fd:datatype base="string"/>
         <fd:booleanfield id="select">

The repeater is bound to the collection:

   <fb:repeater id="current" parent-path="." row-path="current">
       <fb:value id="id" path="@id" direction="load"/>
       <fb:value id="name" path="name" direction="load"/>

As you can see, data is mostly read-only. I am just interested in the 
value of the "select" field for selecting some rows to be further 

I also created a template for displaying the repeater as a two-column 
table. Column 1 is for the "select" widget, whereas column 2 shoud 
display the "name" property. That was easy.

The next requirement is for each "name" to be a link to an URL which 
depends on the value of the corresponding "id". Something like:

     <ft:repeater-widget id="current">
         <td><ft:widget id="select"/></td>
           <a href="/base/[INSERT-ID-HERE]"><ft:widget id="name"/></a>

Now the question is: what would be the easiest way to put the "id" 
property of the bean bound to the current row in place of the 
"[INSERT-ID-HERE]" string?

	Thanks in Advance,


Ugo Cei
Tech Blog:
Open Source Zone:
Wine & Food Blog:

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

View raw message