Title: Héléna Tanguy - Jouve SI
My problem was to bind a form on 2 different xml paths (so 2 bindings), I have resolved it by rewriting binding functions like this :

function createAndGetBinding(bindingURI) {
    var bindingManager = null;
    var source = null;
    var resolver = null;

    try {
        bindingManager = cocoon.getComponent(Packages.org.apache.cocoon.forms.binding.BindingManager.ROLE);
        resolver = cocoon.getComponent(Packages.org.apache.cocoon.environment.SourceResolver.ROLE);
        source = resolver.resolveURI(bindingURI);
        return bindingManager.createBinding(source);
    } finally {
        if (source != null)
            resolver.release(source);
        cocoon.releaseComponent(bindingManager);
        cocoon.releaseComponent(resolver);
    }
}

Then I use this function to create 2 bindings, and I use twice the function loadFormFromModel to load data to my form with the 2 bindings.
I found this solution on a old post about woody, but that already works on cocoon forms.



Barbara Slupik a écrit :
Can you please explain it once again? I don't really understand your problem.

Barbara

On 28 Jul, 2008, at 6:00 pm, Héléna Tanguy wrote:

Hello,

I'm working on a cocoon form with binding on xml document. Now everything works correctly.
But I must make an evolution to this form, the binding must be made on 2 xml different paths.

For example:
Some widgets are binded with this xml path: myData/contacts/contact[position="x"]/name, etc
Some other widget must be binded with this other xml path: myData/customers/customer[position="x"]/customerId, etc.
I must display in my form the contact name and the customer id. The contact in position 1 is the same person than the customer in position 1, etc.
I precise that the xml format cannot be modified, it is a standard format.

In the existing form, the binding was made with "myData/contacts/contact[position="x"]", but it is not possible to bind the other widget with this xml path.

So my question is: how to do the binding with these 2 xml paths ? Is it possible to pass a parameter in the binding file to precise the position for the person ?

Thank you



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



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



--

Héléna Tanguy
Ingénieur logiciel / Software engineer
Propriété industrielle / Industrial Property

12, rue des Landelles - Immeuble Hercule 2 - 35510 Cesson Sévigné - France
Tél. : + 33 (0) 2 99 86 07 52 - Fax : + 33 (0) 2 99 86 98 01

Reply via email to