cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giuseppe Di Pierri" <giuseppe.dipie...@phiware.ch>
Subject Re: binding framework and collections
Date Wed, 11 Oct 2006 07:45:44 GMT
Andre,

to bind a collection you should use fb:repeater or fb:simple-repeater

I hope this helps

pino

On 10/8/06, Andre Juffer <ajuffer@sun3.oulu.fi> wrote:
> 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
>
>

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


Mime
View raw message