cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Verdin <ver...@agrocampus-rennes.fr>
Subject Re: [CForm] binding question
Date Tue, 03 May 2005 09:11:00 GMT
You can embed it in your flowscript.
This is an untested javascript function which should do the trick 
(derived from the Cocoon samples) :

function MyFunction(form) {

     var baseName = cocoon.parameters["base"];
    var source = cocoon.parameters["documentURI"];

    // parse the document to a DOM-tree

    var document = loadDocument(source);

    // bind the document data to the form
    form.load(document);

    // show the form
    form.showForm(baseName+"-display-pipeline");

    form.save(document);
   // get the whole set of form inputs
     var temp = form.getModel();
    // get the content of the form field you use to define your output 
document
    var OutputURI = temp.fieldIndicatingTheOutputURI;
    // Finally, save your data to the right document.
    saveDocument(document, OutputURI);

//send whatever registration confirmation page you use.
    cocoon.sendPage("pipo.html");
}

Something like this, I guess.

Lionel Crine wrote:

> Hi,
>
> I'd like to change my binding document according a field 
> (selectionList) in my form.
>
> How can I do that ?
>
> Tnahs
> Lionel
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message