cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Heiden" <patrickhei...@gmx.de>
Subject Re: dynamic cForms definitions/templates
Date Mon, 21 Jul 2008 07:51:30 GMT
Hi André!

Thank you, I am actually working this through ;)
And I have some questions, maybe cause I am new to cForms...

> Dynamic form definition, binding and templating is a very convenient way 
> to generate forms according to a DB structure that can change. It could 
> perhaps may be more efficient, in a performance point of view, to 
> generate files for definition/binding/template each time the DB 
> structures gets changed, then to read these files with a simple 
> generator. But we never had any performance drawback nor JVM heap space 
> problem.
> 
> Here's a sitemap snippet :
> 
> <map:match pattern="*/*.xhtml">
>                 <map:call function="myForm">
>                     <map:parameter name="form" 
> value="cocoon:/{1}/cforms/form.xml"/>
>                     <map:parameter name="binding" 
> value="cocoon:/{1}/cforms/binding.xml"/>
>                     <map:parameter name="show" 
> value="{1}/cforms/template.xml"/>
>                     <map:parameter name="redirect" value="{2}.html"/>
>                     <!-- document to edit  -->
>                     <map:parameter name="src"
> value="cocoon://{1}/{2}.xml"/>
>                 </map:call>
> </map:match>
> 
> Then, in the  flowscript :
> 
> var redirect = cocoon.parameters.redirect;
> 
> // Form definition
> var form = new Form(cocoon.parameters.form);

Why is this dynamic creation of a form definition? Is there a pipeline behind form-parameter?
What about the src-parameter, it is never used??

> 
> // Binding
> form.createBinding(cocoon.parameters.binding);
> 
> var document = ...
> 
> // load document
> form.load(document);
> 
> // The form to be shown
> form.showForm(cocoon.parameters.show);
> 
> //... processing...
> 
> //... then
> 
> // save document
> form.save(document);
> 
> cocoon.redirectTo(redirect, true);

After saving data from the form, why we need a redirect?

> 
> André
> 
<snip />

Thank you very much. I hope my questions are not 'THAT' silly.

Best regards,
Patrick
-- 
Psssst! Schon das coole Video vom GMX MultiMessenger gesehen?
Der Eine für Alle: http://www.gmx.net/de/go/messenger03

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


Mime
View raw message