Hi Bruno,


This is very helpful, thanks a lot...

On Feb 15, 2004, at 12:18 AM, Bruno Dumon wrote:

<..snip..>
Here's just some pseudocode of how to do it.

First declare a function like this:

function createBinding(bindingURI) {
var bindingManager = null;
var source = null;
var resolver = null;
try {
bindingManager = cocoon.getComponent(Packages.org.apache.cocoon.woody.binding.BindingMan ager.ROLE);
resolver = cocoon.getComponent(Packages.org.apache.cocoon.environment.SourceResolv er.ROLE);
source = resolver.resolveURI(bindingURI);
return bindingManager.createBinding(source);
} finally {
if (source != null)
resolver.release(source);
cocoon.releaseComponent(bindingManager);
cocoon.releaseComponent(resolver);
}
}


(this is mostly identical to the createBinding method in the form object)

Why not just call the form.createBinding(), like woody() does?



then create the bindings like this:


var binding1 = createBinding("binding1.xml");
var binding2 = createBinding("binding2.xml");

and then for loading:

binding1.loadFormFromModel(form.form, bean1);
binding2.loadFormFromModel(form.form, bean2);

and for saving:

binding1.saveFormToModel(form.form, bean1);
binding2.saveFormToModel(form.form, bean2);

Thus when doing things this way, you don't need the form.load and
form.save methods.

Right... got it!


Thanks again,
— Mark


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to