cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <Andre.Juf...@oulu.fi>
Subject Re: binding framework and collections
Date Wed, 11 Oct 2006 09:03:27 GMT
Hi Giuseppe,

thank you for your email. In the mean time I found a solution from the 
cocoon which apparently overlooked (I misunderstood things on first 
reading):

<fb:javascript .. direction="both">
   <fb:load-form>
   ..
   </fb:load-form>
   <fb:save-form>
   ...
   </fb:save-form>
</fb:javascript>

This works quite ok in the case of an always visible (on the screen) 
selection list.

Thanks,
Andre



Giuseppe Di Pierri wrote:
> 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
> 


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

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


Mime
View raw message