On Sun, 2004-02-15 at 10:50, Mark Lundquist wrote:
<snip/>
> > 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?

Because that method doesn't return anything, but stores the binding in a
property of the form object, called binding.

So you could also do:

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

but might be more confusing and makes assumptions on the inner workings
of the form object (there's no 'private' in javascript).

<snip/>

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED]                          [EMAIL PROTECTED]


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

Reply via email to