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 11:07:55 GMT
To submit dynamically, there is the "submit-on-change" attribute. It is 
available for selection-lists.

The problem is to pass your field content to the sitemap to make it use 
a different binding file.

If you use the "cocoon.sendpage" function, you generate a new request 
which will be processed by the sitemap. You can simply use your field 
content as a request parameter (e.g. 
cocoon.sendpage(http://whatever.com?param="your-field-content") ).
This parameter can be used by a flowscript to define a new binding file, 
with the function :

var param = cocoon.request.getParameter("param");

Well, these are just answer elements.
Hope they are usefull... You still have to find out how to retrieve your 
field content to put it in the http request.

Cheers,

David

Lionel Crine wrote:

> I see but my problem is elsewhere : I need to load dynamically a 
> binding document according a parameter in my selection list.
>
>
> besides, I have another idea (easier) :
>
> I'll create a first forms with this list and will process dynamically 
> to the right form.
> By the way, How do I submit dynamically ?
> I'm using
>     
> "<fd:on-value-changed><javascript>?</javascript></fd:on-value-changed>"
> but I don't know the flowscript method to submit the document.
>
>
> Thanks
> Lionel
>
>
>
>
>
>
>
>
>
> David Verdin wrote:
>
>> 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
>>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>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