cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <>
Subject repeater binding
Date Sun, 12 Nov 2006 14:21:02 GMT
Dear All,

As part of a larger form, I've the following very simple repeater (and 
associated repeater-actions):

<fd:repeater id="keywords" initial-size = "1">
     <fd:field id="keyword" required="true">
       <fd:datatype base="string" />
     <fd:booleanfield id="selection">
<fd:repeater-action id="add-keyword" command="add-row"
                         number-of-rows="1" repeater="keywords">
   <fd:label>Add keyword</fd:label>
<fd:repeater-action id="remove-keyword" command="delete-rows"
                     number-of-rows="1" repeater="keywords"
   <fd:label>Remove selected</fd:label>

In addition, the following binding has been constructed (based upon the 
sample in samples/blocks/forms/form2_bind_bean.xml):

<fb:repeater id="keywords" parent-path="." row-path="keywords">
     <fb:value id="id" path="@id"/>
     <fb:value id="category" path="category" />
     <fb:insert-bean classname="Keyword" addmethod="addKeyword" />

Also the following class exists (stripped version):

public class Keyword {
     public Keyword(String keyword);
     public String getKeyword();

(There is no 'setKeyword(String keyword)' method.)

Another class (called 'Specification'), the actual bean, holds these 
keywords as a collection (Set) (stripped version):

public class Specification {
   public void addKeyword(Keyword keyword);
   public void removeKeyword(Keyword keyword);

The form displays itself correctly onto the screen, repeater works fine, 
etc. However, as soon as the Submit button is pressed, cocoon apparently 
ends up in an infinite loop. Nothing is logged in the log files (I run 
with the debug mode). The only thing I can do is to shutdown the servlet 
engine (tomcat 5.5.16).

I suppose the problem is in the binding. Specifically, if I remove the 
<fb:repeater> portion from the binding file, everything works (except of 
course I don't have the keywords saved).

I cannot see what the problem is. There must be something wrong with the 
repeater binding. I was hoping that somebody on this list may have a clue.

In addition, I am not entirely clear on how to remove a Keyword from the 
Specification (the bean). The binding includes an addmethod attribute 
for fb:on-insert-row, but there is no 'removemethod'. I could image to 
have a removemethod attribute for fb:on-delete-row. So, how exactly is 
this handled. Suppose the user returns to the Specification and wants to 
remove keywords. How is this then forwarded to the Specification bean. 
Also the

   <fb:value id="id" path="@id"/>

part is not clear to me. Is the id referring to the id of the repeater? 
And the path is referring to keyword (which has no id). Do I need this?

Thanks for your help,

Andre H. Juffer              | Email:
The Biocenter and            | WWW:
     the Dep. of Biochemistry | Fax: +358-8-553-1141
University of Oulu, Finland  | Phone: +358-8-553 1161

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

View raw message