From: Marc Portier [mailto:[EMAIL PROTECTED]
<snip/>
> It depends on what you call 'binding'
>
> strictly speaking (technically) the woody-binding is about copying
> values between the form-instance and some object-model coming
> from some
> backend....
>
> these object-models are pretty much passive data-structures (value
> objects) and through jxpath the binding supports for them
> being either
> Java-Bean-like or w3c-DOM-like
>
> with 'passive' I mean they just cary data: set/get stuff, but
> do not do
> operations like connect to xindice...
>
>
> I understand that from a user-standpoint the 'binding'
> through methods
> like form.save() is perceived as case closed/over and done with/data
> persisted... but that is not the case: data has just been copied over
> from the web-interaction-model (woody widgets) over to some
> persistance-ready-model
>
> the persistance action is one you still need to do.
>
> When using FlowScript it is really easy to add those
> recurring actions
> to the Form model...
> (check woody2.js to see how that is built up already)
>
> in your own script you could add some custom wrappers around the
> build-in save and load
>
> Form.prototype.loadFromBackendX = function(args){
> this.model = ....
> //whatever needed to load dom from your backend using the args
>
> this.load(this.model);
> }
>
> Form.prototype.saveToBackendX = function(args){
> this.save(this.model);
>
> //whatever needed to persist the this.model back
> ... (this.model);
> }
>
>
> after which you could replace the form.save(domModel) by some more
> direct: form.saveToBackEndX(whateverNeeded)
>
> now, in this case backendX is cocoon (modifiable) sources, so I would
> guess some saveToSource/loadFromSource can be made quite generic and
> might very well be candidates for natural extension of the woody2.js
>
> I would not do away with the existing save/load for the pletora of
> existing back-ends that don't have the 'source' concept
> attaching to it.
I agree! Having save/load and saveToSource/loadFromSource would be nice
and should be official API. I'm going to add this to Bugzilla with a
pointer to this thread.
--
Reinhard