Markus Heussen wrote:

Meanwhile I have found a solution but I don't know if it is the elegant way
;-) Maybe you can have a look at it and do a comment? I have one source but
two or more form defintion files and two or more binding files. Also two or
more templates.


First of all the following call initializes the form part1:



cocoon.sendPage("form.init?function=contractConclusionForm1&form-definition= test1&documentURI=test&bindingURI=test1);


That calls the following sitemap matcher:



<map:match pattern="form.init"> <map:call function="woody"> <map:parameter name="function" value="{request-param:function}"/> <map:parameter name="form-definition" value="cocoon:/forms/descriptors/{request-param:form-definition}.descriptor. xml"/> <map:parameter name="documentURI" value="cocoon:/forms/sources/{request-param:documentURI}.source.xml"/> <map:parameter name="bindingURI" value="cocoon:/forms/bindings/{request-param:bindingURI}.binding.xml"/> </map:call> </map:match>


Then the function "contractConclusionForm1" is called:



function contractConclusionForm1(form) { ... doc = flowHelper.loadDocument(documentURI); // globale form.load(doc); // bind the document data (first part data to first form) form.showForm("portal.base?template=test1", // show with first template { ... } ); form.save(doc); // bind the form's data back to the document

cocoon.sendPage("form.init?function=contractConclusionForm2&form-definition=
test2&documentURI=test&bindingURI=test2);
}


Then the function "contractConclusionForm2" is called:



function contractConclusionForm2(form) { form.load(doc); // bind the document data (second part data to second form) form.showForm("portal.base?template=test2", // show with second template { ... } ); form.save(doc); // bind the form's data back to the document flowHelper.saveDocument(doc,"test2.xml");

        cocoon.sendPage("portal.base",
                        {
...
                        }
        );
}


Is this stupid?


Markus

Well, I don't think putting the function name in the request parameter is all that great of an idea (just think if the wrong function gets called that happens to do something you really don't want), but I'm not all that sure how else it could be done...


Regards,
Tony


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



Reply via email to