cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Billard <olivier.billard.coc...@laposte.net>
Subject Re: Create new form model for later binding
Date Fri, 13 Aug 2004 15:25:28 GMT
Paul Bowler wrote:
> I've got form binding working nicely for existing form documents in my XML database (thanks
for all your help). 
> However, this only works with data that alrady exists within the database. If I try to
use it for a new form instance I 
> get 'No cocoon form found' as there is no data from which to load into the form.
> 
> How can I create a new instance of the form data that can then be bound to the XML database
(i.e. create a new XML 
> document from a given form specification)?
> 
> The script I am using for editing documents is here:
> 
> function editxml(form) {
> 	var form = new Form(cocoon.parameters["form-definition"]);
> 	var bindingURI = cocoon.parameters["bindingURI"];
> 	var dataURI = cocoon.parameters["dataURI"];
> 	var dataURI = cocoon.parameters["formURI"]; 
> 
> 	var doc = loadDocument(dataURI);

var doc = loadDocument("cocoon://data-creation-pipeline");
and here we go :)

> 
> 	form.createBinding(bindingURI);
> 	form.load(doc);
> 	form.showForm(formURI);
> 	form.save(doc);
> 
> 	saveDocument(doc, dataURI);
> }
> 
> I think I need to replace the loadDocument() call but don't know what with.
> 
> Many thanks,
> 
> Paul.
> 
> --
> Paul Bowler
> Aventix Associates Ltd


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


Mime
View raw message