cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niels van Kampenhout <n.vankampenh...@hippo.nl>
Subject Re: binding for multivaluefields
Date Mon, 05 Dec 2005 16:17:03 GMT
cocoon.erard wrote:
> Hello,
> 
> I'm trying to bind a multivaluefield with an object, but this doesn't work.
> 
> I've a bean:
> 
> public class MyBean {
> 
>    private HashMap questions = new HashMap();
> 
>    public HashMap getQuestions() ...
>    public void setQuestions(HashMap questions) ...
> 
> }
> 
> the quesitons map contains Question Objects:
> 
> public class Question {
>    private Object response = null;
> 
>    public Object getResponse()...
>    public void setResponse(Object response)...
> 
> }
> 
> somewhere i make:
> 
> myBean.getQuestions().put("name", new Question());
> myBean.getQuestions().put("languages", new Question());
> 
> the binding:
> 
> <fb:context path="." xmlns:fb="http://apache.org/cocoon/forms/1.0#binding" xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
>     <fb:struct id="1" path=".">
>         <fb:value id="name" path="questions[@name='name']/response"/>
>         <fb:multi-value id="languages" parent-path="questions[@name='languages']/response"
row-path="."/>
>     </fb:struct>
> </fb:context>
> 
> This works fine for the widget 'name'. If response is null, an Object of the correct
type is created for field widgets. If response is != null the content is displayed in the
form.
> But for 'languages' (which is a selection list) I receive allways the exeption at the
end of the mail. 
> I've already tried out other combinations with row-path and parent-path but didn't find
the solution, can someone help me?
> 
> Regars
> 
> Mike

Mike,

It may be that you have to write some custom binding code in an 
<fb:javascript> element. That was the only way I could get 
multivaluefield binding to work properly. For an example, check this 
thread: 
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=109653712005198&w=2.

Niels

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


Mime
View raw message