cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: CForms - load / save to different targets
Date Thu, 23 Sep 2004 16:36:41 GMT
On 23.09.2004 16:46, Jorg Heymans wrote:

> My form has a multivaluewidget, it's values are retrieved from an 
> Arraylist in the bean that is populated using Hibernate. The user then 
> selects a few values and presses "next".
> Now i would like to save these selected values into a different 
> arraylist then the one where the values are retrieved from. Rationale: i 
> don't want to destroy the original dataset because it's quite expensive 
> to retrieve.
> 
> Is changing the setter method for the Arraylist the only option here? Or 
> can i somehow in my javascript binding say "save the collection into a 
> different location in the bean" ?

I would use two bindings, one for load, one for save. So you have also 
two contexts:

<fb:value id="widget" path="context1" direction="load"/>
<fb:value id="widget" path="context2" direction="save"/>

I use this (with repeater bindings) when loading entries from a uploaded 
CSV file (transformed via Chaperon to DOM) and saving to a bean. Thw 
advantage is that the CForms binding framework does the handling of the 
contexts for you, you don't need to navigate in javascript binding using 
JXPath or in your Java code with non-standard setters.

Joerg

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


Mime
View raw message