On Tue, 2003-07-22 at 23:57, Antonio Gallardo wrote:
> Bruno Dumon dijo:
> > [an obvious improvement would be to make the binding also part of the
> > javascript-form-wrapper, so that you don't have to load the binding
> > yourself and can use form.load(object) and form.save(object)]
>
> This would be better if we can also attach a Bean here! I would allow to
> "speak" to a Database using OJB. A scratchpad of how it would be:
>
> We have a Bean filled from a database using OJB.
>
> Then we can use:
>
> function form2(form, myBean, bindingURI) {
> var document = loadBean(myBean);
> var binding = loadBinding(bindingURI);
>
> binding.loadFormFromModel(form.form, document);
> form.show("form2-display-pipeline");
> binding.saveFormToModel(form.form, document);
> fillBean(document, myBean);
> /* We catch the Bean --> use OJB to store to DB */
> ....
> cocoon.sendPage("form2-success-pipeline");
> form.finish();
> }
>
In your example above you're doing:
bean -> document -> form (and the reverse direction)
but you can actually do:
bean -> form (and the reverse direction)
so the bean replaces the document. This was also what I hinted at with
my form.load(object) and form.save(object) methods: the object can be
either a bean or a DOM-tree.
See also Marc's mail for the status of this.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED] [EMAIL PROTECTED]