cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <ajuf...@sun3.oulu.fi>
Subject binding framework and collections
Date Sun, 08 Oct 2006 15:46:06 GMT
Hi all,

I have a problem with updating a POJO java class that contains a set 
using the binding framework as documented at:

http://cocoon.apache.org/2.1/userdocs/binding.html

I have a Parent class with Children (a very simplified example):

binding file:

<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding" path="/" >
   ........
   <fb:value id="children" path="children" />
</fb:context>


Java class (POJO):

class Parent {
   .....
   private Set<String> children;
   public void setChildren(Set<String> names);
   public Set<String> getChildren();
}

I have one form that is processed with flow. This all works very fine 
except that I cannot load the data from the form into the Parent class 
"form.save(bean)" (bean is of type 'Packages.Parent'). I get the 
following error:

java.lang.RuntimeException: Cannot set value of field "names" with an 
object of type java.util.HashSet

I actually tried also with ArrayList. It is easy to solve this problem 
with a Javascript class named Parent instead of a Java POJO class named 
Parent.

My question is now what is the Java collection type that Cocoon can 
handle? Is this in fact even possible? I looked through the 
documentation and also the mailing list, but could not find an example 
or an explanation on this (must have overlooked).

Thanks for your help,
Andre

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


Mime
View raw message